0
Military time code coach
cheems = str(input()) cheems.split() if cheems[1] in dict: print(cheems) dict = { "PM":PM "AM":AM } def AM: print(cheems[0]) def PM: if cheems I stoped writing the code because i Saw it wouldnt work, whats the Best method to solve this
3 Antworten
0
what was your initial method to solve?
0
@Choe first i wouldve split the input into two then define the functions AM and PM, then i wouldve made a dictionary wich would call the functions AM or PM when it would process the second word of the input (AM or PM), then those functions would manipulate the first word of the input wich is the hours and minutes
0
here you go
https://code.sololearn.com/cANHb9Vmhn56/?ref=app