livepython.net

83. Python Program to Print a Multiplication Table

Easyrange()

Overview

A times table: the classic first job for range().

Problem Statement

Read a whole number n and print its multiplication table from 1 to 10. For example, for 7:

7 x 1 = 7
7 x 2 = 14
7 x 3 = 21
7 x 4 = 28
7 x 5 = 35
7 x 6 = 42
7 x 7 = 49
7 x 8 = 56
7 x 9 = 63
7 x 10 = 70

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:

7

Output

The output for that example:

7 x 1 = 7
7 x 2 = 14
7 x 3 = 21
7 x 4 = 28
7 x 5 = 35
7 x 6 = 42
7 x 7 = 49
7 x 8 = 56
7 x 9 = 63
7 x 10 = 70

The tests try 3 different inputs.

Learn this firstChapter 10 · Python range() Function in a for Loop
solution.py
# write your code here

EXPECTED OUTPUT

17 x 1 = 7
27 x 2 = 14
37 x 3 = 21
47 x 4 = 28
57 x 5 = 35
67 x 6 = 42
77 x 7 = 49
87 x 8 = 56
97 x 9 = 63
107 x 10 = 70

YOUR OUTPUT

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