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"

jamie Macdiarmid
jamie Macdiarmid
2,048 Points

Stuck again

It can become gobbledegook when you stare and think about it long enough. Is there a way to get the answers without having to bother people. Can I recomend that Treehouse puts a Timer on the solution e.g if after 10 mins your stuck a solution will appear.

what is the correct answer?

printer.py
def printer(count):
    print("Hi * {} ".format(2))

1 Answer

Hi Jamie, here is the solution to the challenge:

def printer(count):     #you got this part right
  print('Hi' * count)   #now all you have to do is print 'Hi' as many times as the count argument
                        #you can do this by using the multiplication operator: *
Wade Wilson
Wade Wilson
3,505 Points

Thank you, I had it as this...

def printer (count):
    print("Hi " * 4)

I guess it just isn't fully clicking with me that i had include the name of the argument i created. That has been happening a lot this last week while learning python.

jamie Macdiarmid
jamie Macdiarmid
2,048 Points

Thanks Haider. Think I over complicated it.