input: Write a python function to convert a 12-hour time format string (e.g., "3:45PM") to a 24-hour time format string (e.g., "15:45").
  assert time_conversion("3:45PM") == "15:45"
  assert time_conversion("12:30AM") == "00:30"
  assert time_conversion("11:59PM") == "23:59"
  assert time_conversion("1:00AM") == "01:00"
output: def time_conversion(time_str):
      time_period = time_str[-2:]
      hours, minutes = time_str[:-2].split(':')
      hours = int(hours)
      
      if time_period == 'PM' and hours != 12:
          hours += 12
      elif time_period == 'AM' and hours == 12:
          hours = 0
          
      return f"{hours:02}:{minutes}"