Modulo Time Test Cases vs Solution Answers

Back to General discussions forum

parhaml     2015-07-04 14:50:14

I think I have a solution to take a total number of seconds and convert them back to the proper form (D H M S) It passes the three test cases and about half of the formal answers. The other answers are exactly 30 minutes off. I can't tell if they're ahead or behind.

Has there been an issue with this checker or do I need to revisit my math? (Not looking for answers just guidance.) Thanks!

#applicable code Python 2
trip = end - begin
ans_days = trip // 84600
trip -= ans_days * 84600
ans_seconds = trip % 60
ans_minutes = trip // 60 % 60
ans_hours = trip // 60 // 60
drewcocker     2015-07-06 01:21:48
User avatar

You've got a typo in line 3 and 4. (I hope that's suitably vague.)

parhaml     2015-07-14 14:47:27

So simple. Thank you for the second set of eyes.

Please login and solve 5 problems to be able to post at forum