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"

Conner Williams
PLUS
Conner Williams
Courses Plus Student 3,305 Points

how do I write this function?

trying to understand how to use the multiply function in this instance.

printer.py
def printer(count):
    if count() == 10:
        print int("count" * 10)

2 Answers

Steven Parker
Steven Parker
217,533 Points

Here's a few hints:

  • you won't need a conditional
  • you must always have the string "Hi "
  • after you "multiply" the string, don't try to convert it into an integer

You're really close!

At the moment, you've done a lot more than you need to.

You have the first line correct and second line can be deleted since it's not needed.

For the third line, there is no need to covert it into a int, and you accidently turned count into a string.

If you still can't solve it, just reply to this and I'll show you how I solved it.

Hope this helps!