Scientific Computing with Python Projects (Issue with code)

Tell us what’s happening:
I can’t seem to figure out the error

Your code so far

       def add_time(start, duration, arg = "False"):
    #split the time into hour and minutes
    start_hrs = int(start.split(':')[0])
    #convert into a 24hrs format for easier conversions
    if 'PM' in start:
        start_hrs += 12
    start_min = start.split(':')[1].split()[0]
    # Duration time splitted
    duration_hrs = int(duration.split(':')[0])
    duration_min = int(duration.split(':')[1])

    #Amount of days passed Verbose
    hrs = int(start_hrs + duration_hrs)
    min = int(start_min) + int(duration_min)
    total = hrs + min
    days_passed = (total / 60) / 24

    # Calculating hour (24 format)
    future_hrs = (total / 60)  % 24
    print(future_hrs) #PROBLEM HERE SOMEWHWERE
    PM = False
    if future_hrs >= 12:
        future_hrs -= 12
        if future_hrs == 0:
            future_hrs = 12
            PM = True
    if future_hrs == 0:
        future_hrs = 12
    future_min = str((min % 60)).zfill(2)

    if arg == "False":
        if days_passed > 1:
            if PM:
                new_time = f"{future_hrs}:{future_min} PM ({days_passed} days later)"
            else:
                new_time = f"{future_hrs}:{future_min} AM ({days_passed} days later)"
        elif days_passed == 1:
            if PM:
                new_time = f"{future_hrs}:{future_min} PM (next day)"
            else:
                new_time = f"{future_hrs}:{future_min} AM (next day)"
        else:
            if PM:
                new_time = f"{future_hrs}:{future_min} PM"
            else:
                new_time = f"{future_hrs}:{future_min} AM"

    else:
        days = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
        day = days[days.index(arg.capitilize()) + 1 + days_passed) % 7 - 1]
        if days_passed > 1:
            if PM:
                new_time = f"{future_hrs}:{future_min}PM, {day} ({days_passed} days later)"
            else:
                new_time = f"{future_hrs}:{future_min}AM, {day} ({days_passed} days passed)"
        elif days_passed == 1:
            if PM:
                new_time = f"{future_hrs}:{future_min} PM, {day} next day)"
            else:
                new_time = f"{future_hrs}:{future_min} AM, {day} next day)"
        else:
            if PM:
                new_time = f"{future_hrs}:{future_min} PM, {day}"
            else:
                new_time = f"{future_hrs}:{future_min} AM, {day}"

    return new_time

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36.

Challenge: Time Calculator

Link to the challenge:

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).