Created
September 27, 2023 09:47
-
-
Save codeperfectplus/f5b2fdda235bc722b3ba20aaaf276556 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
def timeConversion(s): | |
# | |
# Write your code here. | |
# | |
time = s.split(':') | |
if s[-2:] == "PM": | |
if time[0] != "12": | |
time[0] = str(int(time[0])+12) | |
else: | |
if time[0] == '12': | |
time[0] = '00' | |
ntime = ':'.join(time) | |
return str(ntime[:-2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment