Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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: