title: Break And Continue Statement in nested loops
body: <p>So i was experimenting the for-loop in Python and i decided let me use continue and break statements for experimentation and i got to know what's the difference. So &quot;break&quot; exits your loop completely and &quot;continue&quot; skips the current iteration of the loop and continues it but the headache started when i experimented with the &quot;break&quot; and &quot;continue&quot; in nested loops and i see no difference in the code which i have pasted below</p>
  <p>1.)&quot;break&quot; nested loop.</p>
  <pre><code>for i in range(6):
      print(&quot;iteration {}&quot;.format(i))
      for j in range(6):
          if i == 3:
              break
          print(j)
  </code></pre>
  <p>2.) &quot;continue&quot; nested loop</p>
  <pre><code>for i in range(6):
      print(&quot;iteration {}&quot;.format(i))
      for j in range(6):
          if i == 3:
              continue
          print(j)
  </code></pre>
  <p>And my question is why does &quot;continue&quot; and &quot;break&quot; act the same in nested-loops in my code???</p>
  <p>for those who are wondering Outputs for the loops</p>
  <p>1.)for &quot;break&quot;</p>
  <pre><code>   iteration 0
  0
  1
  2
  3
  4
  5
  iteration 1
  0
  1
  2
  3
  4
  5
  iteration 2
  0
  1
  2
  3
  4
  5
  iteration 3
  iteration 4
  0
  1
  2
  3
  4
  5
  iteration 5
  0
  1
  2
  3
  4
  5
  </code></pre>
  <p>2.)Output for &quot;continue&quot;</p>
  <pre><code>iteration 0
  0
  1
  2
  3
  4
  5
  iteration 1
  0
  1
  2
  3
  4
  5
  iteration 2
  0
  1
  2
  3
  4
  5
  iteration 3
  iteration 4
  0
  1
  2
  3
  4
  5
  iteration 5
  0
  1
  2
  3
  4
  5
  </code></pre>
  <p>Would be great help for the answer!!...thanksss..</p>