0
what is the problem Military Times
t = input().split(":") if t[1][:-3:-1][::-1] == "PM": mt = f"{int(t[0])+12}:{t[1][0:2]}" else: mt = f"{t[0]}:{t[1][0:2]}" print(mt)
2 Respostas
+ 1
You need to add 0(zero) in front of 1-9
+ 1
thank you so much:
t = input().split(":")
if t[1][:-3:-1][::-1] == "PM":
mt = f"{int(t[0])+12}:{t[1][0:2]}"
else:
mt = f"{0 if int(t[0])<10 else ''}{t[0]}:{t[1][0:2]}"
print(mt)