Table of Multiplication for Two

In this program how to print Table of Two and in different types of loops

first we use for loop for printing the Table of Two :

Input :

Table of Two : 2

Output :

2 * 1 :  2

2 * 2 :  4

2 * 3 :  6

2 * 4 :  8

2 * 5 :  10

2 * 6 :  12

2 * 7 :  14

2 * 8 :  16

2 * 9 :  18

2 * 10 :  20

for i in range(1,11):   # we use for 1 to 10
  s=2*i
  print("2","*",i , ":", s)
Now we use while loop for printing Table of Two :
n=1
while n<11:
  t= 2*n
  print("2","*",n , ":", t)

 

For more program practice :

Python program to Identify Even and Odd Elements in List

Find the number is Armstrong number or not // python program

Find the Duplicate Elements in the List – Python List Program

How We Can Use Pip To Install Packages To Anaconda Environment

Leave a Comment

%d bloggers like this: