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 trialSumanta Patel
560 Pointsproblem
def printer(count): print({} * "Hi ".format(count)) printer(5)
def printer(count):
print({} * "Hi ".format(count))
printer(5)
2 Answers
Alexander Davison
65,469 PointsI'm going to list out the lines you wrote along with if it's correct or not:
- You define a function. You did this properly
-
You print "Hi "
times
times. Doesn't seem to do that! I have no idea why you have{}
in there. - Remember, you don't need to call the function. The code challenge does that for you!
Also, you give you a hint on the repeating "Hi ": You can multiply a string by a number, like this! :
Pretend I'm in the Python Shell
>>> 'a' * 5
'aaaaa'
>>> 'ab' * 3
'ababab'
>>> 'Hi ' * 5
'Hi Hi Hi Hi Hi '
I hope these hints help you
If you still continue to fail, please post your new code snippet. Read the Markdown Cheatsheet to see how. The link is located below a comment/answer box.
~Alex
Sumanta Patel
560 Pointsthanks
Sumanta Patel
560 PointsSumanta Patel
560 Pointswhat is wrong in it.. ?