Skip to content

Commit 1ba2ddc

Browse files
authored
Solution
1 parent 39d95ec commit 1ba2ddc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/python3
2+
3+
import os
4+
import sys
5+
6+
def timeConversion(s):
7+
time = s.split(":")
8+
if s[-2:] == "PM":
9+
if time[0] != "12":
10+
time[0] = str(int(time[0])+12)
11+
else:
12+
if time[0] == "12":
13+
time[0] = "00"
14+
ntime = ':'.join(time)
15+
return str(ntime[:-2])
16+
17+
if __name__ == '__main__':
18+
f = open(os.environ['OUTPUT_PATH'], 'w')
19+
20+
s = input()
21+
22+
result = timeConversion(s)
23+
24+
f.write(result + '\n')
25+
26+
f.close()

0 commit comments

Comments
 (0)