title: Advanced loop problems for python
body: <p>I have been learning python through a book called "Introduction to Computer Science Using Python and Pygame". In this book there is a section called advanced loop problems with no explanation or overview on how to do them, but I thought i would attempt them anyway. I have the first 2 of them down thanks to some help from here, and here are the rest:</p>
  
  <p><a href="https://i.stack.imgur.com/4snr9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4snr9.jpg" alt="Probs 1-3"></a>
  <a href="https://i.stack.imgur.com/GBQWQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GBQWQ.jpg" alt="Probs 4-6"></a></p>
  
  <p>Here is the code for the first 2 problems, and my attempt at the third. Any help on the rest of these would be greatly appreciated!</p>
  
  <pre><code>#Problem 1:
  for n in range(10):
      for i in range(10):
          print(i, end=" ")
      print()
  
  #Problem 2:
  for n in range(11):
      for i in range(n):
          print(i, end=" ")
      print()
  
  #Problem 3:
  for n in reversed(range(10)):
      for s in reversed(range(10)):
          print(" ", end="")
      for i in range(n+1):
          print(i, end=" ")
      print()
  </code></pre>