Answer to Question #222377 in Python for srikanth

Question #222377
Day Name

Given day number 

D as input, write a program to display the day name.

(1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday, 7 - Sunday)

Input

The first line of input is an integer 

D.

Output

The output should be a string representing the day name. 

Explanation

For example, if 

D = 3 then, according to the day number, the day should be Wednesday.

Sample Input 1
3
Sample Output 1
Wednesday
Sample Input 2
2
Sample Output 2
Tuesday

1
Expert's answer
2021-08-09T02:34:10-0400
Days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
D = int(input())
print(Days[D - 1])

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