Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • \$\begingroup\$ @StepHen Whoops. Easy fix. \$\endgroup\$ Commented Aug 9, 2017 at 15:28
  • \$\begingroup\$ Fails for 2 01 11 00? In your answer, how do you determine if the time is AM or PM, if you don't take that as input? \$\endgroup\$ Commented Aug 9, 2017 at 15:37
  • \$\begingroup\$ @Mr.Xcoder; I get 13 for that input using the TIO, which is correct (reset+11<9+59). \$\endgroup\$ Commented Aug 9, 2017 at 15:39
  • 2
    \$\begingroup\$ Does % always return a positive number in Python? \$\endgroup\$ Commented Aug 9, 2017 at 16:00
  • 4
    \$\begingroup\$ @Shaggy it always returns the sign of the right side of the %. 1%24 = 1, 1%-24 = -23. It's very helpful for this question. \$\endgroup\$ Commented Aug 9, 2017 at 16:02