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

am i writing this wrong? years *= 365 I keep putting this in and I get a name error

years *= 365

age.py
years = 27
years *= 365

2 Answers

Elad Ohana
Elad Ohana
24,456 Points

Detron,

Your code as written is assigning the variable years to the value of 27, then reassigning the same variable the value of 27(the original value) multiplied by 365. The challenge asks that you assign that value to a variable named "days". Have another try at it!

Elad

Jack Harrison-Sherlock
Jack Harrison-Sherlock
6,002 Points

Hey Detron,

As Elad mentioned, the challenge is asking you to multiply the variable 'years' and assign this as a new variable 'days'.

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