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 (Retired) Things That Count Things That Count

days_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.

Hi Bret,

Let's see your code.

3 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Can 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.

BAM!!! Kenneth I am loving this stuff I got it as soon as I watched the video. Thanks for all your help.

I 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
Kenneth Love
Treehouse Guest Teacher

So 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!