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"

what's wrong with this? It runs fine on the python 3.5 IDLE but not here.

Not sure if I'm not understanding exactly what it's asking me to do, but from what I am understanding, this block should be what it is asking for. I have run this in the python.org python 3.5 IDLE and it seems to run fine.

printer.py
def printer(count):
    return('Hi') * count
print(printer(10))

1 Answer

Steven Parker
Steven Parker
231,236 Points

:point_right: Your code may "work", but it's not what the challenge asked for.

The challenge is to have the function "print "Hi " as many times as the count argument". But your function doesn't print anything (instead it returns a number of "Hi"s).

Rewrite the function to do the printing to pass the challenge. Also, you won't need to call the function yourself, the challenge checker does that.

Thank you so much! Just as a side question, if your only experience with programming is with Treehouse and a few books, no college degree or other certification, but skilled, could you land a programming job?

Steven Parker
Steven Parker
231,236 Points

I've been a programmer for long before I discovered Treehouse, so I'm no personal example. But I've been quite impressed by most of the courses I've taken here so far. I would expect the answer might be "yes", assuming your potential employer is willing to evaluate candidates on skills more than credentials. And I also think that attitude is reasonably common in Tech jobs.

You might try asking again in the "General Discussion" area. Perhaps someone who has already succeeded in doing it will respond.

Michael Hulet
Michael Hulet
47,913 Points

Hi Steven,

I was browsing through the community earlier on my phone, and I noticed something I wanted to comment on when I got back to my Mac, though I see that the thread's now been deleted. Earlier, you said something along the lines of:

Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime. ? -- Maimonides

This was the only reply to another student's answer, and in that context, it felt rather passive-aggressive. I don't believe you were trying to be mean, but please be a little more careful with what you say. If you thought something was wrong with this student's answer, it would've been better to point out exactly what you thought was wrong and to suggest a change. Thanks for all the awesome work you do for the Treehouse community!