In this article, we will be creating Python Program to displays the multiplication table of variable num (from 1 to 10).
To iterate 10 times, for-loop along with the range() function is used. The arguments inside range function are (1,11) meaning, greater than or equal to 1, and less than 11. We have displayed the multiplication table of variable num (which is 13 in our case). You can change the value of num in the below program to test out for other values.
In the program below, we have used the for loop to display the multiplication table of 13.
Python Program to Display the multiplication Table [Source Code]
num = 13 # To take input from the user # num = int(input("Display multiplication table of?")) # use for loop to iterate 10 times for i in range (1, 11): print(num,'x',i,'=',num*i)
13 x 1 = 13
13 x 2 = 26
13 x 3 = 39
13 x 4 = 52
13 x 5 = 65
13 x 6 = 78
13 x 7 = 91
13 x 8 = 104
13 x 9 = 117
13 x 10 = 130
You can run your code here
Along these lines, I really want to believe that you preferred the article and you would have found the substance of the article valuable and supportive for you. Share this article in your coding networks so that more individuals can exploit the substance. In case of any doubt feel free to ask me on social media
- Python Program to choose a random word from the list
- Python Program to Check size of a file
- Amazing tool Auto Copy paste Clipboard Using Python
- Python Program to check Prime Number