diff --git a/24-12format_BAT.py b/24-12format_BAT.py index 314df66..ad1681a 100644 --- a/24-12format_BAT.py +++ b/24-12format_BAT.py @@ -1,11 +1,15 @@ -h=int(input()) -m=int(input()) -s=int(input()) -z=input() -if z=='PM': - nh=12+1*h +h=int(input("Please enter Hours :")) +m=int(input("Please enter the Minutes: ")) +s=int(input("Please enter the Seconds: ")) +z=input("Please enter the time zone in AM or PM: ") +nh=0 #This will be our new hour, which will be zero by default + +if z=="AM": + if h==12: + nh=0 + else: + nh=h + print("The time is:", nh,':',m,':',s) else: - if z=='AM': - if h==12: - nh=00 -print(nh,':',m,':',s) + nh=h + print("The time is:", nh,':',m,':',s)