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"

I am missing a step with count

I have the beginning code added however, it is asking for a count with the code and I am trying to remember how to do this. and I suppose to make it an int?

like make printer(int(print('hi'*3))) or something along those lines or am I making this way more complicated then it should be.

printer.py
def printer():
    print('hi')
printer(3*3)

1 Answer

Thomas McDonnell
Thomas McDonnell
8,212 Points

Your asked to make a function that takes an argument in this case its count, the count will be what you multiply the string "hi" by. Below is how your code should look hope this explains it better.

def printer(count):
    print("hi" * count)