title: Python Odd and Even
body: <p>I am very new to python. I am trying to write a program that tests if a number is between a given range, then tells you if the number is odd or even. I am having trouble with the part that detects if it is odd or even. It seems that if it just repeats my even statement. Here is the code:</p>
  <pre><code>while True:
      num = int(input(&quot;Please enter an integer between 1 and 50: &quot;))
      if num &gt;= 1 and num &lt;= 50:
          for num in range (1, 50):
              if (num % 2 == 0):
                  print(&quot;Your number is even.&quot;)
          else:
              print(&quot;Your number is odd.&quot;)
          
      else:
          print(&quot;Try again. Number must be 1 through 50.&quot;)
  </code></pre>