Created
July 12, 2020 03:47
-
-
Save Abhayparashar31/c06a73b953550565f096a6a974700814 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
data = input() | |
if data[-2:]=='PM' and int(data[:2])!=12: | |
hour = data[:2] | |
hour=int(hour)+12 | |
less = data[2:-2] | |
datas=str(hour)+less | |
print(datas) | |
elif data[-2:]=='AM' and int(data[:2])!=12: | |
print(data[0:-2]) | |
elif data[-2:]=='AM' and data[:2]=='12': | |
temp='00' | |
datas=temp+data[2:-2] | |
print(datas) | |
elif data[-2:]=='PM' and int(data[:2])==12: | |
print(data[:-2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment