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

Python Basics - Stage 3 - Challenge task 4 of 4

Not sure how to finish out this code. Challenge reads: "Finally, create 2 new variables, one named estimate that holds the rounded number of decades you've lived and, one named summary that adds the string version of estimate into "I am {} days old! That's about {} decades!" with the correct values added to it."

I have:

age = 30
days = age*52*7
decades = age/10
estimate = round(decades)
summary = str(estimate)
print("I am {} days old! That's about {} decades!".format(days, summary))

It works in the console but the challenge isn't accepting the code.

4 Answers

Your thinking is correct but you missed a little bit in the challenge.

Actual final value should sit in the variable called summary.

summary = "I am {} days old! That's about {} decades!".format(days, str(estimate))

I hope this helps.

Jordan Pike
Jordan Pike
5,699 Points

I was just working on this one and found my error was I had typed format.(days, str(estimate)) rather than the correct answer of .format(days, str(estimate))

Really fun figuring out the mistakes along the way!

Thanks for the quick response. I had actually tried that code first, but was receiving errors. Maybe a typo. Will try again.

Yeah, I had a typo in my code. I knew that was the way to go. Should have stuck with it before posting. Thanks all!