id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

bryce.hulett@hotmail.com > convert_24_hour
prev  |  next  |  chance

Write a function that converts a string in military or 24-hour format to the current time in 12-hour format. Calling convert_24_hour("17:02:05") should return "05:02:05 PM".


convert_24_hour('17:02:05') → '05:02:05 PM'
convert_24_hour('03:45:55') → '03:45:55 AM'
convert_24_hour('00:22:00') → '12:22:00 AM'

...Save, Compile, Run (ctrl-enter)

def convert_24_hour(s):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 100 Post-solution available

Copyright Nick Parlante 2017 - privacy