Python @ DjangoSpin

PyPro #55 Printing multiplication tables

Buffer this pageShare on FacebookPrint this pageTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUpon
Reading Time: 1 minutes

printing multiplication tables in Python

printing multiplication tables in Python

Printing multiplication tables: Write a Python program to print first 5 multiples of a given number in the format 5 x 2 = 10.

printing multiplication tables

number = 5

for quotient in range(1, 6):
	print('{} x {} = {}'.format(number, quotient, quotient * 5))
	
## 5 x 1 = 5
## 5 x 2 = 10
## 5 x 3 = 15
## 5 x 4 = 20
## 5 x 5 = 25

See also:

Buffer this pageShare on FacebookPrint this pageTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUpon

Leave a Reply