Question #293912

given weekday of the first day of the month, determine the day of the week of the given date in that month.

input: 1st line is a string-D

2nd line is a integer-N


Expert's answer

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!

LATEST TUTORIALS
APPROVED BY CLIENTS