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 (2015) Python Data Types Age Calculation

python basics

Challenge Task 1 of 3

Let's calculate, with a bit of imprecision, how many days old you are.

First, create a variable named years. Assign years to the number of years old you are. This should be an integer.

age.py
years = age 25 


days = (age * 7 * 52)

print (days)

summary = 365 * days 

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

2 Answers

Hi Princess,

It wants you to create a variable called years and assign an integer value to it. Your first line does that, nearly - just remove the word age.

Next, create a variable called days and assign years * 365 into it. And lastly, create a variable called weeks which is days / 7.

That all looks like:

years = 25
days = years * 365
weeks = days / 7

I hope that helps,

Steve.

steve yu are the best

No problem, but I'm not sure if your answer is the 'Best' one?