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 Functions and Looping Functions

Mark Chang
Mark Chang
5,214 Points

Code cant run

I run the code it shows on video at 3:09 but it says : Traceback (most recent call last):
File "notifications.py", line 4, in <module>
result = praise + "!" + number_of_charaters
TypeError: must be str, not int

1 Answer

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hey Mark,

I have watched the video and edited my answer. You have a typo in the code. You have to multiply the exclamation mark with the number_of_charaters instead of performing an addition. If the number_of_charaters contains, let's say 5 characters, the exclamation mark will be printed out 5 times. Neat right :)

Mark Chang
Mark Chang
5,214 Points

Thanks for your answer have a good day! ?