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 is a argument

how do i solve this? so i tried it on work space def printer(5): and it gave me a syntax error. then i tried def printer(Hi): print("Hi " * 4) and it worked out. but when i tried it for the "Challenge Task" it flopped. what is a argument? and why is def printer( any int ) doesn't work?

P.S i managed to get this right somehow but i forgot how i did it. please help

printer.py
def printer():
    print("Hi " * 4)

2 Answers

Tate Price
PLUS
Tate Price
Courses Plus Student 9,987 Points

The code you are looking for should be this

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

Let me know if this doesn't work.

It worked thank you, i guess when i had my eureka moment i was like its in challenge task. haha.

Tate Price
PLUS
Tate Price
Courses Plus Student 9,987 Points

I'm glad it worked, if it was helpful I would appreciate it if you would pick a best answer. Thanks, and happy coding!