-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhile loop.py
More file actions
60 lines (43 loc) · 733 Bytes
/
Copy pathwhile loop.py
File metadata and controls
60 lines (43 loc) · 733 Bytes
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
#while loop
is_faild = True
i = 1
while is_faild :#and i<=100:
if i%2!= 0: #is not even
i= i + 1
continue
print(f"try{i}")
i= i + 1
if i>100:
break
print("i gave up")
#counting
i=0
while i<=10:
print(i)
i +=1
#nested while loops
w = 0
while w <=10:
x = 0
while x<w:
print("kiran", end="_")
x+=1
print("")
w +=1
#ATM PIN
pin = "1234"
trials = 1
while trials<=3:
input_pin = input(f"Trail-{trials} | PIN :")
trials +=1
if input_pin == pin:
print("CORRECT")
break
else:
print("INCORRECT")
# 5 table using while loop
num = 5
i = 1
while i<=10:
print(f"{num} x {i} = {num*i}")
i +=1