Alakítsd át a bekért időt 24 órás formátumra!
Idő: 8:30 pm
def convert_to_24h(time):
    if "am" in time.lower():
        time = time.replace('am', '')
        hour, minute = map(int, time.split(':'))
        if hour == 12:
            hour = 0
    elif "pm" in time.lower():
        time = time.replace('pm', '')
        hour, minute = map(int, time.split(':'))
        if hour != 12:
            hour += 12
    else:
        return "Hibás bemenet!"
    return "{:02d}:{:02d}".format(hour, minute)

print(convert_to_24h("8:30 pm"))