James W. answered 06/23/23
MIT Math and Computer Science Teacher
Hi,
Please see the above code.
(1) we specify two simple functions to convert minutes to days and to convert days to years
NOTE: there's also a library called datetime which would help you immensely for practical problems like this but I'm assuming this is for learning so we do the calculations "by hand"
(2) from the input we first calculate the total days
(3) convert that to years and use the math.floor function to round down
(4) then we calculate how many days we have leftover (and round down for an approximation)
Hope this is clear!