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"

Didn't find the concept in the video

Hey guys I didn't find in the video how you can print something as many times as the argument of the function. The task tells me to print "Hi " as many times as the "count" argument in the function, the only block of code that I found in the video was this: ... def printer(count): if count.lower() == count: print"Hi " ... but it doesn't work, can somebody help me with this? Thanks ;)

printer.py
def printer(count):
    if count.lower() == count:
        print"Hi "

1 Answer

Reyam Marcos
PLUS
Reyam Marcos
Courses Plus Student 10,367 Points

Hi... you can multiply string by * sign, check this one

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

hope it helps

Thanks Reyam! ;) good coding!