Tell us what’s happening:
I clicked the link to open the repl.it project(https://repl.it/github/freeCodeCamp/boilerplate-time-calculator). A new window opens and starts loading the project then it gets stuck.
Your code so far
def add_time(start, duration, *args):
if not args == ():
print(args[0].lower())
args=args[0].lower()
else:
args ="oh no"
# print(args)
new_time= 0
week={1:"Sunday",2:"Monday",3:"Tuesday", 4:"Wednesday", 5:"Thursday", 6:"Friday", 7:"Saturday",8:"Sunday",9:"Monday",10:"Tuesday", 11:"Wednesday", 12:"Thursday", 13:"Friday", 14:"Saturday",15:"Sunday",16:"Monday",17:"Tuesday", 18:"Wednesday", 19:"Thursday", 20:"Friday", 21:"Saturday"}
for items in week:
if week[items].lower()== args:
first = items
break
else:
first = 0
#print(first)
initial_time = start.split(":")
dur_frac = duration.split(":")
meridian =start[start.find("M")-1:]
increment_mns = (int(dur_frac[0])*60)+int(dur_frac[1])
if meridian == "PM":
starts = (int(initial_time[0])+12)*60 +int(initial_time[1][:2])
else:
starts= int(initial_time[0])*60 + int(initial_time[1][:2])
ftime_hrs= (((starts+increment_mns)/60))
ftime_mns= (((starts+increment_mns)%60))
#print(("total time in hrs"),(ftime_hrs))
#print("minutes on final time",(ftime_mns))
if ftime_hrs > 24:
fin_add= int(ftime_hrs)- int(ftime_hrs/24)*24
days = int(ftime_hrs/24)
else:
fin_add= int(ftime_hrs)
days = 0
if days == 0:
forcast = ""
elif days == 1:
forcast = " (next day)"
elif days >1:
forcast = " ("+str(days)+" days later)"
if args=="oh no":
cal = ""
else:
cal = ", " +str(week[first+days])
first= first + days
#print(fin_add)
#print("fin_add~~",fin_add, fin_add/12)
#print("days",days)
if fin_add >= 12 and fin_add < 24:
merid ="PM"
elif (fin_add > -1 and fin_add <12) or fin_add ==24 :
merid ="AM"
if fin_add == 0:
fin_add = 12
if fin_add > 12 :
#print("End tim_e",fin_add-12, ftime_mns )
hour= fin_add-12
elif fin_add > -1 and fin_add < 13:
# print("End times_6546",fin_add, ftime_mns)
hour = fin_add
if ftime_mns <10:
mins= "0" +str(ftime_mns )
else:
mins = str(ftime_mns)
new_time =str(hour)+ ":"+ mins +" "+ merid +cal + forcast
print(new_time)
return new_time
add_time("6:30 PM", "205:12", "monDay")
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0.
Challenge: Time Calculator
Link to the challenge:

