Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Carole Cox
429 PointsShould the formula in the challenge be weeks = days /52 ?
The problem may be incorrect...just sayin...:-)
1 Answer

Chris Freeman
Treehouse Moderator 67,989 PointsThe total weeks would be either the total days / 7: (years * 365) / 7
,
or be the number of years * "weeks per year". While these would be close, "years * 52
" would be an integer number of weeks, while dividing the total days by 7 would yield a more accurate floating point result.
>>> years = 32
>>> days = 365 * years
>>> weeks_from_days = days / 7
>>> weeks_from_years = years * 52
>>> weeks_from_years
1664
>>> weeks_from_days
1668.5714285714287
Carole Cox
429 PointsCarole Cox
429 PointsThank you! A nice expanded explanation but I think that Treehouse set the problem up wrong or worded it wrong. In real time Weeks is not days /7. In other words. My age =61 ; days =61 *365 =22,265. then Weeks would be days/52 not 7. in my case 428. Oh my! Not a big deal..it just "looks wrong". But thank you , your answer is helpful in other ways!!!
Chris Freeman
Treehouse Moderator 67,989 PointsChris Freeman
Treehouse Moderator 67,989 PointsHey Carole, I think your math has an error.
Using "unit management" we can check our units. Starting with an initial value, then multiplying by unity values (=1) to convert to other units. Similar units values will cancel leaving the final value and units.
I think you may be confusing the conversion factors.. "
1/52
" would be a "years per weeks" conversion which doesn't help when starting with days.