Multiplication Table Generator
Easypython
Print the multiplication table of a given number, from 1 to 10.
Approach: loop i from 1 to 10 with a for loop and range(), printing one line per value in the exact format n x i = n*i.
Input: One line: a whole number n.
Output: 10 lines, one per i from 1 to 10: n x i = <n*i>
Example 1
Input
5
Output
5 x 1 = 5 5 x 2 = 10 5 x 3 = 15 5 x 4 = 20 5 x 5 = 25 5 x 6 = 30 5 x 7 = 35 5 x 8 = 40 5 x 9 = 45 5 x 10 = 50
- -1000 <= n <= 1000
Hint 1
range(1, 11) produces 1 through 10.
Hint 2
Each line follows the pattern f"{n} x {i} = {n*i}".
A single for i in range(1, 11) loop covers multipliers 1 through 10; each iteration prints f"{n} x {i} = {n*i}", which is exactly the required line format.