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"

Dennis Moriarity
PLUS
Dennis Moriarity
Courses Plus Student 940 Points

need help

Not sure what i am missing to make this work.

printer.py
def printer(count)
    count = int(input("Enter a number: "))
except ValueError:
    print("Hi " * count)

2 Answers

stjarnan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
stjarnan
Front End Web Development Techdegree Graduate 56,488 Points

Hi Dennis,

I think you're overcomplicating the challenge a bit, the challenge is asking you to:

# Create a function named printer that takes an argument called count
def printer(count):
    # print "Hi " as many times as the count argument
    print( "Hi " * count)

I hope this helps

Jonas

Dennis Moriarity
PLUS
Dennis Moriarity
Courses Plus Student 940 Points

Thanks Jonas, I realized that I did not have the ":" after def printer(count). It works now.