Write Multiplication Table Using While Loop In Python

 Write Multiplication Table Using While Loop In Python

Code:

Num = int(input("Enter The Number :"))
i = 0
while i<10 :
    i = i+1
    print(f"{Num}X{i}={Num*i}")
    # or
    # print(Num,"X",i,"=",Num*i)
    # or
    # print(str(Num) + "X" + str(i) + "=" + str(Num*i))

Output:

Enter The Number:8
8X1=8
8X2=16
8X3=24
8X4=32
8X5=40
8X6=48
8X7=56
8X8=64
8X9=72
8X10=80

Download Code


Comments

Popular posts from this blog

Write A Python Program, Create n Empty Dictionary Allow 4 Friends To, Enter Their Favorite Programming Language As values and User Keys as their Name Assume That The Names Are Unique.

Write Python Program To Store Seven Fruits Name In a List Enter By The User