wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Write a function to print the table of a given number. The number has to be entered by the user.

Open in App
Solution

Program:
#Program to print the table of a number
num = int(input("Enter the number to display its table: "))
print("Table: ");
for a in range(1,11):
print(num," × ",a," = ",(num*a))



OUTPUT:
Enter the number to display its table: 5
Table:
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


flag
Suggest Corrections
thumbs-up
19
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Arithmetic Mean and Range
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon