write a program or display the table of a number for class 7 and chapter name is loops in python
Answers
Answered by
3
Table - Python
We need to first take User input to accept the number (the number of which we can get out the table).
We store the number as an integer value. Then, we calculate the multiplication of the table for the number and display it.
The Program
# the table of a number
# take input from the user
num = int(input("Enter a number: "))
# Iterate 10 times from i = 1 to 10
for i in range(1, 11):
print('%d × %d = %d' %(num, i, num*i))
Sample output
5
5 × 1 = 5
5 × 2 = 10
5 × 3 = 15
5 × 4 = 20
5 × 5 = 25
5 × 6 = 30
5 × 7 = 35
5 × 8 = 40
5 × 9 = 45
5 × 10 = 50
[Program finished]
To know more about Loops/Looping, refer to the link below.
brainly.in/question/48289163
Similar questions