Computer Science, asked by choudhary21, 8 months ago

Hey❤️❤️❤️❤️


.
.
.
Write a python program that prompts the user to input a number.The program should display corresponding days to the number.Example:- if the user types 1 the output should be sunday and if the user types 7 the day should be saturday.​​


thanks❤️❤️​

Answers

Answered by llɱissMaɠiciaŋll
35

Explanation:

# Taken day number from user

weekday = int(input("Enter weekday day number (1-7) : "))

if weekday == 1 :

print("\nMonday");

elif weekday == 2 :

print("\nTuesday")

elif(weekday == 3) :

print("\nWednesday")

elif(weekday == 4) :

print("\nThursday")

elif(weekday == 5) :

print("\nFriday")

elif(weekday == 6) :

print("\nSaturday")

elif (weekday == 7) :

print("\nSunday")

else :

print("\nPlease enter weekday number between 1-7.")

The Excel WEEKDAY function takes a date and returns a number between 1-7 representing the day of week. By default, WEEKDAY returns 1 for Sunday and 7 for Saturday. You can use the WEEKDAY function inside other formulas to check the day of week and react as needed.

Purpose

Get the day of the week as a number

Return value

A number between 0 and 7.

Syntax

=WEEKDAY (serial_number, [return_type])

Arguments

serial_number - The date for which you want to get the day of week.

return_type - [optional] A number representing day of week mapping scheme. Default is 1.

Usage notes

WEEKDAY accepts a date and returns a number between 1-7 representing the day of week for that date. By default, WEEKDAY returns 1 for Sunday and 7 for Saturday.

Answered by shrutisharma4567
1

Explanation:

 \huge {\underline{ \bf \red{HEYA\:MATE}}}

\huge\underline{ \mathbb\red{❥A} \green{n} \mathbb\blue{S} \purple{w} \mathbb \orange{E} \pink{r}}\:

Explanation:

# Taken day number from user

weekday = int(input("Enter weekday day number (1-7) : "))

if weekday == 1 :

print("\nMonday");

elif weekday == 2 :

print("\nTuesday")

elif(weekday == 3) :

print("\nWednesday")

elif(weekday == 4) :

print("\nThursday")

elif(weekday == 5) :

print("\nFriday")

elif(weekday == 6) :

print("\nSaturday")

elif (weekday == 7) :

print("\nSunday")

else :

print("\nPlease enter weekday number between 1-7.")

The Excel WEEKDAY function takes a date and returns a number between 1-7 representing the day of week. By default, WEEKDAY returns 1 for Sunday and 7 for Saturday. You can use the WEEKDAY function inside other formulas to check the day of week and react as needed.

Purpose

Get the day of the week as a number

Return value

A number between 0 and 7.

Syntax

=WEEKDAY (serial_number, [return_type])

Arguments

serial_number - The date for which you want to get the day of week.

return_type - [optional] A number representing day of week mapping scheme. Default is 1.

Usage notes

WEEKDAY accepts a date and returns a number between 1-7 representing the day of week for that date. By default, WEEKDAY returns 1 for Sunday and 7 for Saturday.

\huge{\red{\tt Hope \: it \: helps \: you}}

\color{lightgreen}{{MARK IT AS BRAINLIEST!! }}

Similar questions