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 trialJamaru Rodgers
3,046 PointsWhat's the problem here?
I cant figure out what I did wrong. Did I do the wrong operation syntax or am I really missing a line of code somewhere?
def printer(count):
return "Hi " * count
printer(7)
hiply = printer(7)
print(hiply)
1 Answer
Stuart Wright
41,120 PointsThe problem is that the challenge asked you to make a function that prints something. Instead, you have created a function that returns something, and you then print that outside of the function definition. The end result is the same, but these challenges can be quite picky so you need to follow the instructions exactly.
def printer(count):
print("Hi " * count)
printer(7)
Jamaru Rodgers
3,046 PointsJamaru Rodgers
3,046 PointsThanks. The directions always get me cause I'm almost never spot on but like you said, the code still works. But thanks for this!!