```
def add_time(start, duration,day=False):
daysofweekindex = {'monday':0,'tuesday':1,'wednesday':2,'thursday':3,'friday':4,'saturday':5,'sunday':6}
daysofweekarray = ['Monday','Tuesday','Wednesday','Thursday','Friday','Satuday','Sunday']
duration_tup = duration.split(':')
duration_hour = duration_tup[0]
duration_min = duration_tup[2]
start_tup = start.strip(':')
am_pm_tup = start_tup[2].split(' ')
start_hour = start_tup[0]
start_min = am_pm_tup[0]
ini_am_or_pm = am_pm_tup[1]
am_pm_inverse = {'AM':'PM','PM':'AM'}
end_min = start_min+duration_min
if end_min>= '60':
start_hour += 1
end_min = end_min%60
end_hour = (start_hour+duration_hour)%12
if end_min>'9':
end_min=end_min
else:
end_min = '0'+str(end_min)
end_hour = end_hour=12 if end_hour=='0'else end_hour
amount_of_day = int(duration_hour/24)
amount_of_am_pm_inverse = int((start_hour+duration_hour)/12)
if( ini_am_or_pm == 'PM' and (start_hour + (duration_hour%12)) >= '12'):
amount_of_day +=1
if (amount_of_am_pm_inverse%2 ==1):
am_or_pm = am_pm_inverse[ini_am_or_pm]
else:
am_or_pm = ini_am_or_pm
return_time = str(end_hour)+':'+ str(end_min)+" "+str(am_or_pm)
if day:
day = day.loewr()
index = int(int((daysofweekindex[day]) + (amount_of_day)%7)
**return_day = daysofweekarry[index]**
n_retun_time = return_time + str(return_day)
if amount-of_day == 1:
return n_return_time + " " +'(next day)'
else:
return n_return_time + " " +'('+str(amount_of_day)+'days later)'
return n_return_time
```

what does the syntax error say?

```
**return_day = daysofweekarry[index]**
```syntax error in this line
```

python main.py

Traceback (most recent call last):

File “main.py”, line 2, in

from time_calculator import add_time

File “/home/runner/boilerplate-time-calculator/time_calculator.py”, line 46

new_day = daysofweekarray[i]

^

SyntaxError: invalid syntax

exit status 1

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.