livepython.net

120. Python Program to Find the Day Name from a Number Using a Tuple

EasyTuples

Overview

The days of the week never change, so they belong in a tuple. Read a number and use it as an index.

Problem Statement

Store the seven days in a tuple, from Monday to Sunday. Read a whole number and print the name of that day: 1 is Monday, 7 is Sunday. For example, for 3:

Wednesday

If the number is not between 1 and 7, print:

Invalid day

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

Input

One whole number. Example:

3

Output

The output for that example:

Wednesday

The tests try 5 different inputs.

Learn this firstChapter 14 · Python Tuples: Create, Read and Why They Can't Change
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.