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 trialStephen Scribner
209 PointsAssistance with Things That count
I'm curious why my summary statement is failing. I have used the format() function, but would like to understand why the concatenation isn't passing.
age = 26
days = age * 52 * 7
estimate = round(days)
summary = "I am " + estimate + " days old!"
2 Answers
Laura Cressman
12,548 PointsThink about the type of variable that estimate is. In order to concatenate it with another string, it too must be a string. Since it is currently an integer, you need to change it to a string first. Try this:
age = 23
days = age * 52 * 7
estimate = round(days)
summary = "I am " + str(estimate) + " days old!"
Merry Christmas, Laura :)
Stephen Scribner
209 PointsThank you, makes sense now!