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 trialPaul Je
4,435 PointsUnsure how to format with the right syntax
Not sure how to write this so that count multiplies the string printouts.. tried using brackets in seemingly every combination, any help would be appreciated..
count = 10
printer = print("Hi ") * count
3 Answers
Leo Jacoby
2,785 PointsWhat you need to do is put the "* count" inside the "print" statement. The code would look like:
printer = print("Hi " * count)
This should help.
Stephan Olsen
6,650 PointsAs Jenny said, you need to place the count inside the parenthesis. Also the challenge asks you to write a function, so you need to define a function named printer and not just a variable -->
def printer(count):
print("Hi " * count)
kachrimanidisprodromos
1,151 Pointscount = (the number of times you want to print the "Hi")
def printer(count)
print("Hi" * count)