Multiplication Table Generator

Write a Python program that takes a number from the user and prints its multiplication table up to 10.

Example 1:

Input: 5
Output:
5
10
15
20
25
30
35
40
45
50

Example 2:

Input: 2
Output:
2
4
6
8
10
12
14
16
18
20

A for loop could be used to iterate 10 times, each time multiplying the input number by the current iteration count.

n = int(input())
for i in range(1, 11):
    print(n * i)

© Let’s Data Science

LOGIN

Unlock AI & Data Science treasures. Log in!