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
Carl Taggett
10,321 PointsHelp with Age question. Not sure is this is working the right way or if im wrong.
Hello - Im not sure but it seem like this should be calculating as how the question is asked.
Question: Great! Now we need to multiply the number years by the number of days in a year. We'll ignore leap years, so just multiply years by 365 and assign it to the variable days.
This is the second Code Challenge in the Python basics Tasks
The first question was years = 34 my age so for the answer for the second question I did
1) multiply the number years by the number of days in a year years * 34 hit return should come out 1156 as it does in the workspace. then step 2) and assign it to the variable days. days = 1156
However its not calculating when I hit return. I do this in the workspace and it works perfect. I could also be doing this totally wrong. Not sure.
2 Answers
Tobias Helmrich
31,604 PointsHey Carl,
there are 365 days in a year (there are exceptions but we're just assuming this in the challenge) so you should multiply the years variable by 365 which should be 12410 days.
years = 34
days = years * 365
I hope that helps! :)
Aditya Saini
683 Pointsthanks!
Carl Taggett
10,321 PointsCarl Taggett
10,321 PointsOhhh ! I see. I was doing the whole set up wrong. Thank you very much!