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"

I must not know what they're asking..

So it works in eclipse, and I must say I am very happy about the bit of code I wrote.

Earlier I had similar code that required me to use a number for count, I choose 3 and it worked fine.

What do they want?

3 Answers

Nathan Tallack
Nathan Tallack
22,159 Points

What they are trying to do here is show you that you can multiply strings when using the print function.

So your code could look like this.

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

Take note of the space after the Hi inside the quotation marks. :)

Ah, I guess I was over complicating it then. Thankyou! :)

John Goldring
John Goldring
634 Points

Hi, I have been stuck on this challenge. My code:

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

would not work. Could you briefly tell me why challenge doesn't like it the other way around?