Objective
Create a program with argparse that shows the multiplication table of a number, with options to choose the range. The arguments of each test are passed to the program as if you typed them in the terminal (they appear in the test cases).
Instructions
- Positional argument
n(integer) and options--from(default 1) and--to(default 10), both integers. Sincefromis a reserved word in Python, store that option withdest="start". - Flag
--even: if present, only the rows whose result is even are shown. - For each
ibetween the start and the end (both included) shown x i = result. If the range is empty, nothing is shown.
3 x 1 = 3
3 x 2 = 6
3 x 3 = 9
3 x 4 = 12
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise