-
Notifications
You must be signed in to change notification settings - Fork 19
/
test_while2.py
executable file
·80 lines (63 loc) · 1.64 KB
/
test_while2.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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
OntCversion = '2.0.0'
# !/usr/bin/env python3
i = 0
items2 = 0
def Main():
global items2, i
j = 0
k = 0
h = 0
s = 0
while i < 500:
if i > 80:
break
while j < 10:
if j == 8:
break
while k < 20:
if k == 11:
i = i + k
k = k + 3
continue
k = k + 1
j = j + 1
i = i + j + k
while h < 30:
print("in last while")
h = h + 1
s = s + h
s = s * h
if h == 25:
h = h + 2
continue
s = s / h
i = i + h; items = range(3, 100); items2 = ['a', 'b', 'c', 'd']; count = 0
for x in items: # 3
print("1 level")
count = count + 1
for y in items2: # 4
print("2 level")
count = count + 1
if count > 20:
print("for 2 level break")
break
for z in items: # 3
print("3 level")
if count > 5:
print("for 3 level continue")
continue
count = count + 1
count = count + 2
if count > 60:
print("for 1 level break")
break
i = i + count + s
print(i) # i = 8342
assert(i == 8342)
test()
def test():
assert(i == 8342)
assert(items2[0] == 'a')
assert(items2[1] == 'b')
assert(items2[2] == 'c')
assert(items2[3] == 'd')