SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def convert24(str2):
  2.     if int(str2[:2]) < 12:
  3.         return str2 + " AM"
  4.     else:
  5.         return str(int(str2[:2]) - 12) + str2[2:8] +" PM"
  6.  
  7.  
  8. tim = input("Enter time in 24 hour format:")
  9. print(convert24(tim))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top