title: How to structure nested for loops?
body: <p>I am new to Python. I have been studying <code>for</code> loops but I can't seem to get my head around NESTED <code>for</code> loops. I am doing a problem which requires knowledge of nested <code>for</code> loops, which I do not know how to do!</p>
  <p>Problem:</p>
  <blockquote>
  <p>Write a for loop that produces the following output:</p>
  </blockquote>
  <pre><code>0
  1
  2
  3
  4
  5
  6
  7
  8
  9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  0
  2
  4
  6
  8
  10
  12
  14
  16
  18
  0
  3
  6
  9
  12
  15
  18
  0
  4
  8
  12
  16
  </code></pre>
  <p>Caveat: You can only use up to two <code>for</code> loops</p>
  <p>My Code:</p>
  <pre><code>c = 0
  for i in range(1, 5):
      for j in range(10):
          print(i * c)
          c = c + 1
  </code></pre>
  <p>Any help will be appreciated. I just cannot get my head around nested <code>for</code> loops. It would be great if anybody could guide me.</p>