livepython.net

73. Python Program to Find the Day Name from Its Number

MediumIndexing

Overview

Turn a number from the user into a list index, and check it first.

Problem Statement

Store the days Monday to Sunday in a list. Read a day number (a whole number). Day 1 is Monday and day 7 is Sunday. If the number is from 1 to 7, print the day name; otherwise print Invalid day. For example, for 3:

Wednesday

Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.

Input

One value per line, in this order. Example:

3

Output

The output for that example:

Wednesday

The tests try 5 different inputs.

Learn this firstChapter 9 · Python List Index: Get and Change Items
solution.py
# write your code here

EXPECTED OUTPUT

1Wednesday

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.