Write a python program to input week number and print week day
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
For implementing this, we need to take input from the user and store it in a variable. After taking input from the user, we have to compare that number with 1 to 7 or we can say comparing that number with a day of a week. So the logic goes like – if the number is equal to 1 then it is Monday, if the number is 2 then it is Tuesday, like that we have to compare with each day of the week.
The given Python program implements the above logic and prints the week day -
Output1:
Enter weekday number (1-7) : 5 Friday
Output2:
need an explanation for this answer? contact us directly to get an explanation for this answerEnter weekday number (1-7) : 2 Tuesday