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
Mark Chang
5,214 Pointswhat wrong with my code?
This is the link of codes: https://w.trhou.se/5k1hh5yvms (the snapshot of code) https://teamtreehouse.com/workspaces/37642412 (link to work space) click nortification.py for the code that i want to ask
i run the code 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
Eric Harris
2,391 PointsNumber_of_charaters is an integer and must be converted to a string before concatinating. Try this:
Result = praise + “!” + str(number_of_charaters)
Mark Chang
5,214 Pointsit works but it shows this: YOU ARE DOING GREAT!19 not YOU ARE DOING GREAT!!!!!!!!!!!!!!!!!
Grigorij Schleifer
10,365 PointsHey Mark, see my answer to your second question in the forum. Basically you have a typo :)
Mark Chang
5,214 PointsI forgot that i create new question :)
Grigorij Schleifer
10,365 PointsGrigorij Schleifer
10,365 PointsI would create as many questions as you need and go from there :)