We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce60a96 commit cd7f52eCopy full SHA for cd7f52e
24 hr.py
@@ -0,0 +1,19 @@
1
+
2
+def convert24(str1):
3
4
+ if str1[-2:] == "AM" and str1[:2] == "12":
5
+ return "00" + str1[2:-2]
6
7
8
+ elif str1[-2:] == "AM":
9
+ return str1[:-2]
10
+ elif str1[-2:] == "PM" and str1[:2] == "12":
11
12
13
+ else:
14
15
+ return str(int(str1[:2]) + 12) + str1[2:8]
16
17
18
+str1=input("enter time")
19
+print(convert24("str1"))
0 commit comments