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

challenge 3 things that count

how do i solve this question? please help. finally, create 2 new variables, one named estimate that holds the rounded number of days you've lived and one named summary that adds the string version of estimate into "i am {} days old.

days_alive.py
age= 24
days= 8736
estimate= 8736

3 Answers

Vittorio Somaschini
Vittorio Somaschini
33,371 Points

Ops I forgot to copy a " when posting back:

summary = "I am {} days old!.format(estimate)

Should be :

summary = "I am {} days old!".format(estimate)

Also, your days variable, should not be the direct result of the product, but something like this:

days = age * 52 * 7

Try that and if it does not work, please paste here your full code.

ty

thanks for the help Vittorio!!!

Vittorio Somaschini
Vittorio Somaschini
33,371 Points

Hey. I see your code has a couple of things to correct

number 2 should be:

days = age * 52 *7

number 3:

estimate = round(days, 0)

number 4:

summary = "I am {} days old!".format(estimate)

They need to be precisely like those..

thanks a lot. let me correct those

Thank you, I was struggling on line 4 as well and that helped me out

Vittorio Somaschini
Vittorio Somaschini
33,371 Points

Hello there.

So estimate needs to contain the number of rounded days, like this:

estimate = round(days, 0)

Then, summary has to be the string, with a placeholder {} anf formatted with estimate:

summary = "I am {} days old!.format(estimate)

And you should be fine to go.

Honestly I can't remember why we are asked to round the number of days, nor I can understand it now as a multiplication like the one we have should already return an integer, maybe someone can refresh this to me too.

If any problems let me know ..

Vittorio

hello. thank you Vittorio. but i tried it that way and it keeps telling me name error or your variable should be the rounded version of your days variable even after rounding it. so i'm a little lost now