title: How do I write an iterative function that computes the sum of the first n odd numbers it returns 1 + 3 + .... + (2n - 1), using a for loop?
body: <p>Assuming that <code>n</code> is a positive integer</p>
  
  <p>this is my code:</p>
  
  <pre><code>def sum_odd_n(n):
      x =1
      for x in range(n):
          if x%2==1:
              continue
          return x + 2
  </code></pre>
  
  <p>but when I run it on Python it gives me the answer <code>2</code>. Could you help me by telling me what's wrong and what I should do to solve this?</p>