days= ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
a= input()
b = int(input())
i = b % 7 -1Â
if a in days:
  d = days.index(a)+i
if d >= 7:
  d = d - 7
print(days[d-1])
this code is not working
how to print days
days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
# Output of all days
for day in days:
print(day)
# Output day by index
d_index = int(input('Enter day index: '))
print(days[d_index%7-1])
#In the future, if you want to get a more accurate answer to the broken code,
#attach descriptions of the task that the code should perform.
Comments
Leave a comment