I am working on the second project at FCC, the Time Calculator, and all working, passing tests except the days. This is part for the day code, getting error message: TypeError: unhashable type: ‘list’
Any hint/advice?
#day - list
#days_of_week - dictionary
#day_key - list
day = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
day_key = [1, 2, 3, 4, 5, 6, 7]
days_of_week = { "Monday" : 1,
"Tuesday" : 2,
"Wednesday" : 3,
"Thursday" : 4,
"Friday" : 5,
"Saturday" : 6,
"Sunday" : 7}
if day:
day_value = int(days_of_week[day] + n) % 7
new_day = day[day_value]
#for example
# day = starting day, n days later
day = "Tuesday"
n = 16