File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ # while loop
2
+
3
+ # i = 1
4
+ # while i < 10:
5
+ # print('looping number of i value is : {}'.format(i))
6
+ # i += 1
7
+
8
+ # while loop exercise
9
+ p = 0
10
+ t = 5
11
+
12
+ # while t > p :
13
+ # print('p is' , p, 't is' , t)
14
+ # t -= 1
15
+
16
+ # break and continue
17
+
18
+ # for pt in 'pathein':
19
+ # if pt == 'n':
20
+ # break
21
+ # print('without break')
22
+
23
+ # print('----------breaked--------------')
24
+
25
+
26
+ # for pp in 'yangon':
27
+ # if pp == 'n':
28
+ # continue
29
+ # print('without break',pp)
30
+ # print('---------continue-----')
31
+
32
+
33
+
34
+ # while and break programm
35
+ ls = [10 ,20 ,60 ,99 ]
36
+ compareNum = 99
37
+ found = False
38
+ index = 0
39
+ # print(len(ls))
40
+
41
+ while index < len (ls ):
42
+ if ls [index ] == compareNum :
43
+ found = True
44
+ break
45
+ index += 1
46
+
47
+ if not found :
48
+ # print(not found)
49
+ ls .append (compareNum )
50
+
51
+ # print(ls)
52
+
You can’t perform that action at this time.
0 commit comments