Answer to Question #259706 in Python for Sai

Question #259706

Day name-2

1
Expert's answer
2021-11-01T06:35:45-0400
dayNames = ['Sunday','Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
d= input('Enter the weekday of the first day of the month: ')
N = int(input('Enter an integer: '))
i = N%7-1 
if d in dayNames:
    j = dayNames.index(d)+i
    if j >= 7:
        j = j - 7
    print(dayNames[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