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

Part 4 of python challenge task am not sure what its asking me to do

final should look like?

3 Answers

Here is the code:

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

The format automatically converts any number, boolean and any other types to a string.
I know that by the documentation: format(...) format(value[, format_spec]) -> string Hope that helps :smiley:

Does that help: age = 45 days = age * 52 * 7 decades = age / 10 estimate = round(decades) summary = "I am {} days old! That's about {} decades!".format(days, estimate)

ok well i wanted to know how you get the days and estimate to strings since it needed to be strings this what i did "I am " + str(days) + " days old! That's about" + str(decades) + " decades!" I didnt understand that days and decades needed to be string to set to summary but understand..... and does the format method does this automatically? as u showed me it much easier i would say...