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 trialScott Hetrick
7,725 PointsPython 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
nvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsYour 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
5,699 PointsI 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!
Scott Hetrick
7,725 PointsThanks for the quick response. I had actually tried that code first, but was receiving errors. Maybe a typo. Will try again.
Scott Hetrick
7,725 PointsYeah, I had a typo in my code. I knew that was the way to go. Should have stuck with it before posting. Thanks all!