Advertisements
Advertisements
Question
Write a program to display a multiplication table for a given number.
Solution
Coding:
num=int(input(“Display Multiplication Table of “))
for i in range(1,11):
print(i, x ,num, ‘=’, num*i)
Output:
Display Multiplication Table of 2
1 x 2 = 2
2 x 2 = 4
3 x 2 = 6
4 x 2 = 8
5 x 2 = 10
6 x 2 = 12
7 x 2 =14
8 x 2 = 16
9 x 2 =18
10 x 2 = 20
>>>
APPEARS IN
RELATED QUESTIONS
How many important control structures are there in Python?
Elif can be considered to be the abbreviation of ______.
Which statement is generally used as a placeholder?
The condition in the if statement should be in the form of ______
Which is the most comfortable loop?
Write a note on the range () in the loop?
Using if..else..Elif statement writes a suitable program to display the largest of 3 numbers.
Write the syntax of the while loop.
Write a detail note on for loop?
Write a detailed note on if..else..elif statement with suitable example.