input: Write a python function to convert a given time in 24-hour format to 12-hour format.
  assert convert_time('20:45') == '08:45 PM'
  assert convert_time('00:00') == '12:00 AM'
  assert convert_time('12:30') == '12:30 PM'
output: def convert_time(time_24h):
      hours, minutes = map(int, time_24h.split(':'))
      period = 'AM' if hours < 12 else 'PM'
      hours = hours % 12
      if hours == 0:
          hours = 12
      return f"{hours:02}:{minutes:02} {period}"