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!

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"

Martin Bornman
Martin Bornman
Courses Plus Student 12,662 Points

Again what is wrong with this code?

Can someone please help me with this??

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


1 Answer

Hi Martin,

Your code isn't doing anything with the count parameter that it takes. Additionally, while you can multiply a String, you can't multiply the print() method. So you'd want to enclose the multiplication inside the print() method, and make it multiply by the parameter count instead of hardcoding the multiplication to 3.

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

#  To call your method;