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"

Alexandra Ciorra
seal-mask
.a{fill-rule:evenodd;}techdegree
Alexandra Ciorra
Python Web Development Techdegree Student 796 Points

Can't find correct answer!!!!

I have typed over and over. I have read the teacher notes. Looked up questions. Watched the video over and over again. Why can't I get the right answer. Can someone please explain the correct answer. When I put in in python it works but i can't get passed this question!

printer.py
del printer(count):
    print("Hi" * 10)
Andrea Bell
Andrea Bell
5,167 Points

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

You put del and it is def. count is a variable = to any number you pass into the function.

Alexandra Ciorra
seal-mask
.a{fill-rule:evenodd;}techdegree
Alexandra Ciorra
Python Web Development Techdegree Student 796 Points

Thanks everyone for your answers I really appreciate the help but I'm still getting it wrong with del printer(count): print("Hi " * count)

2 Answers

you need to do the following:

def printer(count):
   a_string = ("Hi" * count)
   return a_string

printer(3)

You define function with use of the keyword def.

If it asks you to avoid calling the function then just remove the printer(3) at the end

Andrea Bell
Andrea Bell
5,167 Points

It is def not del.