Loading...
Loading...
Loading...
A trainer makes a times table chart for a classroom. Given n, print n x 1 up to n x 10, one line per row, in the form n x i = result.
7 x 1 = 7.Example
Input
7
Output
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
Try the problem first. Open one hint at a time.
Loop with a counter from 1 to 10.
Use an f-string to build each line from n, the counter and their product.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor