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 trialCoding Lab 6
2,170 Pointschallenge task "hi" re: function
Write a function named printer. The function should take a single argument, count, and should print "Hi " as many times as the count argument. Remember, you can multiply a string by an integer.
don't know what I"m doing wrong....I suspect I need to get the argument to change after each print "hi" but can't figure it out after multiple trie
def printer(count):
if count()== 1,2,3
print ("hi ")
count("1,2,3")
MICHAEL P
5,191 PointsMICHAEL P
5,191 PointsFirst thing that you need to do is write a function named printer :
def printer(count):
The next thing to do:
Second, we want to print "Hi" as many times as the count argument. In Python if we do 'Hi ' * 3 we will get Hi Hi Hi. So to continue our code then...
def printer(count): print("Hi " * count)
The operator that you are using in this case, is the operator that means multiplication.
I hope that clears things up for you