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

Jessica Brown
Jessica Brown
228 Points

Task 2 of age video

I have tried every way I know how, to complete this task .How do I multiply years by the number of days in a year and then assign it to days? I have tried ex: years * 365 = days 30 * 365 = days (since I am 30 yrs old.) 10950 = days 30 * 365 = days

nothing seems to work. Can someone help me?

age.py
years = 30
years * 365 = days

1 Answer

Charles Kenney
Charles Kenney
15,604 Points

Jessica,

You should be using the assignment operator (or "=" sign) at the beginning of your declaration of the variable 'days'.

Here is what the code should look like:

years = 30
days = years * 365

-Charles