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 trialRamanathan Meyyappan
3,088 PointsWrite a function named printer. The function should take a single argument, count, and should print "Hi " as many times
I dont know how to mutiply the string and integer and print the data
2 Answers
john larson
16,594 PointsIf you need an explanation of this let me know
def printer(count):
print("Hi " * count)
James Joseph
4,885 Pointsjohn larson could you explain this to me? I think it makes sense but I just want to understand why to be sure? Or anyone for that matter.
john larson
16,594 Pointsthe string, "hi" is multiplied by whatever number is passed in to the count var. I'm happy to discuss it further if that doesn't address your question :D
James Joseph
4,885 Points@john larson, thanks that makes sense.