Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics (2015) Logic in Python Print "hi"

Hard time understanding this printer function

Him trying to understand where do i put the count in this function im trying to create. Can anyone help me understand these instructions?

def printer:

   return("Hi" * 15)
count = printer()

1 Answer

Aaron Nolan
Aaron Nolan
5,714 Points

So you need to create this printer function that takes an argument count (provided behind the scenes by Treehouse) and whatever number they provide, will be how many times "Hi" is printed, so the code would look like this :

def printer(count):
    print("Hi " * count)

Hope this helps! Happy coding :)

Dude, thats where the count gets me. As I see your code and read the instructions it all makes sense. Thank you so much.