Times Table Machine โ๏ธ
Homework machine time. ๐ You're building a program that prints any times table, from 1 to 10, looking like this:
7 x 1 = 7
7 x 2 = 14
7 x 3 = 21
...
7 x 10 = 70
The trick is an f-string that does the maths inside the braces:
number = 3
i = 4
print(f"{number} x {i} = {number * i}") # โ 3 x 4 = 12
Change number at the top and the whole table changes. That's the
magic of variables. โจ
Your mission
Print the full times table (rows 1 to 10) for the number variable,
using one f-string inside a loop. Pick any number you like โ as long
as it's 2 or bigger!
Your code
Press โถ Run to see what your code does!