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 trialPiyush Patel
17,253 PointsUnable to solve this
I don't know what is wrong with this code. Can someone please help me?
Thank you very much.
def printer(count):
print "Hi" * count
2 Answers
Stuart Wright
41,120 PointsThe print function requires that you wrap parentheses around the string you want to print:
def printer(count):
print("Hi" * count)
Piyush Patel
17,253 PointsOh, I tried my function in my python shell. It worked, but I didn't realise I'm running Python 2.7.
Thanks though.
Stuart Wright
41,120 PointsAh yes, your code is correct for Python 2.x. All Treehouse courses are Python 3.x so would recommend downloading that for your local system.