title: Convert military time to regular time in python
body: <p>I need to write a Python file that converts military time to regular time. In military time, hours are numbered from 00 to 23, like midnight is 00, 1 a.m. is 01, 1 p.m. is 13. Time in hours and minutes is given as a 4 digit string with minutes following hours and given by 2 digits from 00 to 59. For example, military time 0022 = regular time 12:22 am.</p>
  <p>I tried this:</p>
  <pre><code>time = eval(input('Enter military time: '))
  
  def time():
      return time[:2] + ':' + time[2:]
  </code></pre>
  <p>but it does not work with input starts with 0 and I don't know how to convert the input as 'regular time' - 00=12:00</p>
  <p>Would like to know what kind of approach should I take.</p>