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"

Having some trouble

I know im wayy off but could i get some help?

printer.py
def printer(count):
    print("Hi") * {} .format(count)

1 Answer

Sorry I didn't read the answer. I thought u were trying to put name with Hi. My mistake. I saw the challenge. You need to print hi. So, try this code below. def printer(count): print("Hi"*count) when a string is multiplied with a int, the print function prints the string as many times as the value that count contains. I apologize for the mistake, hope this helps

when i did that i got NameError: name 'printer' is not defined

I edited the answer above, if u have any doubt, feel free to ask me.

Thanks it helped a lot i understand now

can you look at my most recent post

I have answered you question in post but I could not format it. Do u know how to do the formatting