tests: Add another test for break-from-for-loop.
This commit is contained in:
parent
ff8da0b835
commit
049a01d148
|
@ -13,3 +13,15 @@ def foo():
|
||||||
i -= 1
|
i -= 1
|
||||||
|
|
||||||
foo()
|
foo()
|
||||||
|
|
||||||
|
# break from within nested for loop
|
||||||
|
def bar():
|
||||||
|
l = [1, 2, 3]
|
||||||
|
for e1 in l:
|
||||||
|
print(e1)
|
||||||
|
for e2 in l:
|
||||||
|
print(e1, e2)
|
||||||
|
if e2 == 2:
|
||||||
|
break
|
||||||
|
|
||||||
|
bar()
|
||||||
|
|
Loading…
Reference in New Issue