Answer to Question #266195 in Python for Bayernmunich

Question #266195

In the given example, D = Monday.As the 1st of the day of the month is a Monday, it means the 7th and 14th of the month will be Sundays (A week has 7 dats). So the 16th day (N = 16) of the month will be Tuesday.


Sample Input:

Monday

16


Sample Output:

Tuesday


1
Expert's answer
2021-11-15T07:37:03-0500
list1 = ['Sunday','Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
input1 = input('Enter the first day of the month here: ')
input2 = int(input('Enter desired integer here: '))
i = input2%7 -1 
if ​input1 in list1:
​j = list1.index(input1)+i
​if j >= 7:
​j = j - 7
​print(list1[j]

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS