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 trialMUZ140057 Dumisani Nyamusa
8,029 Pointslearn python
finally, create 2 variables named estimate that holds the rounded number of days you have lived and one named summary that adds the string version of estimate into "I am () days old.
age = 26
days = 9464
decade = 2.6
estimate = 3
2 Answers
Kenneth Love
Treehouse Guest TeacherDon't figure the math out yourself, let Python do the work for you.
As for estimate
and summary
, estimate
should use round()
to turn your decades
float into an integer. summary
ends up being a string like "I am 3000 days old! That's about 1 decades!"
. Again, let Python do this work.
MUZ140057 Dumisani Nyamusa
8,029 Pointsdecades = 3ooo / 10
Kenneth Love
Treehouse Guest Teacher3ooo
isn't going to be valid anywhere since that's a three and three o
s. You need to actually use 0
s
dd56
175 Pointsdd56
175 PointsHello kenneth,
could you please have a look the error I made for the task 3 of the challenges
thank you so much
age = 27 days = age * 52* 7 estimate = round (days) summary = "I am" estimate "days old!"
Kenneth Love
Treehouse Guest TeacherKenneth Love
Treehouse Guest Teacherdanqing dong Your
summary
variable isn't be constructed correctly. You need to add the values together with string concatenation (+
) or use the.format()
method.