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 trialBrett Burky
3,895 Pointsdays_alive.py
I am working in Challenge task 4 of 4 and ran into some minor issues.
I think I'm close but there is still something that I am missing. Any help is appreciated.
3 Answers
Kenneth Love
Treehouse Guest TeacherCan you give us some information about what's not working?
The task wants you to create a new variable, estimate
, that's the round()
ed value of decades
.
Then, somehow, get estimate
and days
into the string "I'm X days old! That's about Y decades!" with days
for the X and estimate
for the Y. This string should be stored in a variable named summary
.
Brett Burky
3,895 PointsBAM!!! Kenneth I am loving this stuff I got it as soon as I watched the video. Thanks for all your help.
Brett Burky
3,895 PointsI apologize it was late when I was doing that and I think I got pulled away, won't happen like that again that question gave you nothing to use.
Anyhow this is what I have so far:
age = 35
days = (35 * 52) * 7
decades = 35/10
estimate = round(3.5)
summary = "I am ("days") old! That's about ("decades") decades!"
Kenneth Love
Treehouse Guest TeacherSo that's a good start.
You should probably be using the variables instead of calculating the values yourself. For example:
age = 35
days = age * 52 * 7
decades = age/10
estimate = round(decades)
That way you're not doing work that Python can do for you.
For the summary
variable, be sure and check back at the String Formatting video. You're so close!
Jeff Busch
19,287 PointsJeff Busch
19,287 PointsHi Bret,
Let's see your code.