-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoop.py
More file actions
66 lines (55 loc) · 1.15 KB
/
Copy pathLoop.py
File metadata and controls
66 lines (55 loc) · 1.15 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# For loop
# While Loop
# While Ture
# Nested Loop
# print("For loop")
# for i in range (2,11,2):
# print(i)
#
# print("\n")
# number = int(input("Enter the value of table : - "))
# for i in range(1, 11,2):print(number,"*",i,"=",number * i)
# print("\n")
# print("While Loop")
# a = 1
# n = int(input("Enter the table value:- "))
# while a<=10:
# print(n,"X",a, "=", n*a)
# a+=2
#
# print("\n")
# print("While True loop")
#infinity loop system
while True:
num1 = int(input("enter the number :- "))
num2 = int(input("enter the number :- "))
print(num1 + num2)
repeat = input("do you want to stop the program: ")
if repeat.lower() == "yes":
break
print("\n")
######################
# print("Nested Loops")
# for i in range (1,2):
# for j in range (1, 11):
# print(j)
# print()
#
#
# ## pattern
# for i in range (1,6):
# for j in range (1, i+1):
# print(j, end =" ")
# print()
# Example
for i in range (1,121):
if i % 8 == 0 and i % 12 ==0:
print(i)
print("\n")
n = 1
while n <= 10:
if n == 3:
print("done")
else:
print(n)
n += 1