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"

function name printer.. Would really appreciate assistance

def printer(count): if count == int: print("Hi") printer(1)

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

printer.py
def printer(count):
    if count == int:
        print("Hi")
printer(1)

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

2 Answers

You are very close. Couple of pointers.

  1. There is no need to to type check count. If you did want to do this then you have to use the following
if type(count) is int:
# do something
  1. You need to pass in count to printer as you have in the first printer function
def printer(count):
    print('Hi' * count)

printer(1)  # test function  

Hope this makes sense

I found the answer!!! I really appreciate your help, you guys answer fast.. Very impressive! This is what i put def printer(count): if count > 0: print("Hi " * count)

printer(1) Thank you Stuart, I'm just seeing your response. I don't think I've gotten help that fast.. Classrooms included. Ha.