Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.