**Tell us what’s happening:**

everything works but I’m receiving an error.

**Your code so far**

```
(https://replit.com/@J1Universe/boilerplate-time-calculator-1#time_calculator.py)
def add_time(start, duration, day=False):
minute,period = start.split(" ")
hour, minute = minute.split(":")
endHour, endMinute = duration.split(":")
hour, minute = int(hour), int(minute)
endHour, endMinute = int(endHour), int(endMinute)
index=0
testday= ''
dow=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
hour=int(hour)
minute=int(minute)
endHour=int(endHour)
endMinute=int(endMinute)
testMinute=minute+endMinute
testHour= hour+endHour
period=period.lower()
testMinute=minute+endMinute
while testMinute >60:
testMinute=testMinute-60
testHour=testHour+1
def days_later(index):
if index==0:
string=""
elif index==1:
string=" (next day)"
elif index>=2:
string= " ("+str(index) +" days later)"
return string
while testHour>=12:
if testHour>12:
if period=="am":
testHour=testHour-12
period="pm"
elif period=="pm":
index=index+1
days_later(index)
testHour=testHour-12
period="am"
elif testHour==12:
if period=="am":
period="pm"
elif period=="pm":
index=index+1
days_later(index)
period="am"
break
if day:
for i in range(6):
if day.lower()==dow[i].lower():
testday=', '+dow[i+index]
period=period.upper()
return(f'{testHour}:{testMinute:02} '+period+testday +days_later(index))
```

**Your browser information:**

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

**Challenge:** Scientific Computing with Python Projects - Time Calculator

**Link to the challenge:**