
def foo():
    seq = [1, 2, 3]
    v = 100
    i = 5
    while i > 0:
        print(i)
        for a in seq:
            if a == 2:
                break
        i -= 1

foo()


def foo():
    seq = [1, 2, 3]
    v = 100
    i = 5
    while i > 0:
        print(i)
        for a in seq:
            if a == 2:
                break
        i -= 1

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()

Add another test for break-from-for-loop.
tests: Add another test for break-from-for-loop.

  
  def foo():
      seq = [1, 2, 3]
      v = 100
      i = 5
      while i > 0:
          print(i)
          for a in seq:
              if a == 2:
                  break
          i -= 1
  
  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()
+ 
Add another test for break-from-for-loop.
## Code Before:

def foo():
    seq = [1, 2, 3]
    v = 100
    i = 5
    while i > 0:
        print(i)
        for a in seq:
            if a == 2:
                break
        i -= 1

foo()

## Instruction:
Add another test for break-from-for-loop.
## Code After:

def foo():
    seq = [1, 2, 3]
    v = 100
    i = 5
    while i > 0:
        print(i)
        for a in seq:
            if a == 2:
                break
        i -= 1

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()
