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

Kevin Jervis
Kevin Jervis
2,600 Points

Working out my age in days

Hi

I have got so far in this particular task and got stuck trying to work out my age in days but not sure about the next step:

years = 38 days = 38 * 365

Thanks Kevin

age.py
years = 38
days = 38 * 365 

4 Answers

Michael Hulet
Michael Hulet
47,913 Points

You're definitely on the right track, but the challenge asks you to use the years variable to multiply instead of typing out your age in years again. You're right that years would be 38 at that point, but instead of writing 38 again, if you use years, you'll pass the challenge

Do you noT have To consider leap years? This would make The challenGe a liTTle more challenGinG

Michael Hulet
Michael Hulet
47,913 Points

Nope, leap years and such are not necessary. This challenge is mostly just to get you acquainted with multiplication and variables in Python

[Moderator redacted]
Michael Hulet
Michael Hulet
47,913 Points

Yup, that looks good! Also, I prettified your code a bit to make it easier to read here. You can do this in the future, too. You can read about how in the Markdown Cheatsheet linked under every comment box, or you can just press the "Edit" button on your answer. I also highly recommend the Markdown Basics to learn more about what you can do with it

Michael Hulet
Michael Hulet
47,913 Points

Also, it just occurred to me that you're not the OP, so I should point out that it's frowned upon here to post a copy/paste solution to a challenge with no explanation whatsoever. If you'd like, feel free to add it back, but with a bit of explanation of why that's the answer. Thanks for helping out around the Community!

I am not sure what happened did the moderator deem my input too revelatory

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Lester Peterkin answers that can be copy/pasted into a challenge simply to pass the challenge with no explanation whatsoever are not terribly helpful to the original poster in terms of learning a concept. As such, the answer has been altered. But you are free to change it back, provided you also add an explanation of why/how your code works :sparkles:

Kevin Jervis
Kevin Jervis
2,600 Points

Thank you for your help guys. I appreciate it. Onto the next stage now :o)