Scientific Computing with Python Projects, I wrote the code that achieves every single case mentioned in the file, but it did not pass the unite test, I need help.
type or paste code here

def convert24(str1):
        clock, period = str1.split()
        return str1

    hours, minutes = clock.split(":")
    # Checking if last two elements of time
    # is AM and first two elements are 12
    if period == "AM" and hours == "12":
        return "00" + minutes

    # remove the AM
    elif period == "AM":
        return clock

    # Checking if last two elements of time
    # is PM and first two elements are 12
    elif period == "PM" and hours == "12":
        return clock


        # add 12 to hours and remove PM
        t=int(hours) + 12
        return f'{t}:{minutes}'

def add_times_only(time,duration):
    new_time= convert24(time)
    new_duration= convert24(duration)
    new_time_hours, new_time_minutes= new_time.split(':')
    new_duration_hours, new_duration_minutes= new_duration.split(':')
    total_hours= int(new_time_hours)+ int(new_duration_hours) +int((int(new_time_minutes)+ int(new_duration_minutes))/60)
    total_minutes= (int(new_time_minutes)+ int(new_duration_minutes))%60
    return f'{total_hours}:{total_minutes}'

def days_counter(time):
    time_hours, time_minutes=time.split(':')
    counter= int(int(time_hours)/24)
    remain_hours= int(time_hours)%24
    massege= str()
    if counter ==0:
        return time
    elif counter == 1:
        massege = "next day"
        massege = f'{counter} day later'

    return (f'{remain_hours}:{time_minutes}', f'({massege})')

def convert12(str1):
    time_hours,time_minutes = str1.split(':')
    period = int(int(time_hours)/12)
    if period == 0:
        period = "AM"
        period = "PM"
    return f'{result_hours}:{time_minutes} {period}'

def add_time(time,duration):
    computing_time = convert24(time)
    computing_duration= convert24(duration)
    total_sumation= add_times_only(computing_time,computing_duration)
    computed_total= days_counter(total_sumation)
    return f'{convert12(computed_total[0])}, {computed_total[1]}'

Function is missing optional ability to add name of the starting day of week. Optional as in function has the capability of handling it, but not every time such possibility will be needed. There is also slight difference in formatting when results is next or further day. Notice in examples there’s no comma added in such case.