title: Sum of odd numbers using while loop in python
body: <p>I'm new to programming and was asked to sum odd numbers from 1 to (2*n)-1 using a while loop. 
  This is my attempt:</p>
  
  <pre><code>def sum_odd_n(n):
      while n&lt;2*n:
          sum = 0
          if n%2==1:
              sum = sum+n
      return (sum)
  </code></pre>
  
  <p>May i know my mistake? Any help will be appreciated</p>