-
Notifications
You must be signed in to change notification settings - Fork 151
/
Copy pathMultiplication_Table.py
36 lines (28 loc) · 958 Bytes
/
Multiplication_Table.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Multiplication Table - While Loop (using user input)
number = int(input("Enter any number to see Multiplication Table: "))
count = 1
while count <= 10:
number *= 1
print(f"{number} X {count} = {number*count}")
count += 1
#--------------------------------------------------------------------
# Multiplication Table - For Loop (using user input)
number = int(input("Enter any number for Multiplication Table: "))
for i in range(1, 11):
# num = number * i
# print(number, "x", i, "=",num)
print(number, "X", i, "=",number * i)
#--------------------------------------------------------------------
# Multiplication Table - For Loop (Static way)
n = 0
for i in range(1,11):
i *= 9
n += 1
print(f"{9} X {n} = {i}")
#--------------------------------------------------------------------
# Multiplication Table - While Loop (Static way)
i = 1
while i <= 10:
number = i * 9
print(f"{9} X {i} = {number}")
i += 1