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 trial

Python Python Basics (2015) Logic in Python Print "hi"

David Gourley
David Gourley
3,818 Points

print "hi" challenge

Hi guys, I'm stuck here, i keep throwing the error - "Bummer, didn't find the right number of 'hi's'" It doesn't say anywhere an explicit number to print so I'm not sure what I'm not seeing. Any help would be appreciated thanks.

printer.py
def printer(count):
    print("Hi")

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! This is part of the point of functions. We want to be able to pass a function (sometimes) a piece of information and have it use that information to do a calculation. But that information may vary with time or depending on the situation. In this case, Treehouse is going to call your function and it's going to send a number into it. That number will be assigned to the variable count. You are supposed to print out "Hi" however many times that count is set to. But we have no idea what number they're going to send in. They could send in 5, 7, or 100. We just have no way to know.

This makes our code flexible. Take another look at the "Hint" provided in the challenge and then know that you can multiply a string by a number.

I think you can get it with these hints, but let me know if you're still stuck! :sparkles: