title: How to write a for loop program that finds the sum of all odd numbers in a range, but does not use the if function
body: <p>I need to write a code that asks for user input 'num' of any number and calculates the sum of all odd numbers in the range of 1 to num. I can't seem to figure out how to write this code, because we had a similar question about adding the even numbers in a range that I was able to figure out. </p>
  
  <p>I've also added the lines of code that I've written already for any critiques of what I may have done right/wrong. Would greatly appreciate any help with this :)</p>
  
  <pre><code>total = 0
  
  for i in range(0, num + 1, 1):
      total = total + i
  return total
  </code></pre>