title: How to fix "TypeError: '>' not supported between instances of 'int' and 'NoneType'" in PY4E
body: <p>Im doing py4e assignment 5.2. In the browser when im typing my code everything works, however when I try using CMD, code doesn't work giving error:"TypeError: '>' not supported between instances of 'int' and 'NoneType'"</p>
  
  <pre><code>largest = None
  smallest = None
  while True:
      sval = input("enter a number ")
      if sval=="done":
          break
      try:
          fval = int(sval)
      except:
          print("Invalid input")
          continue
      if fval &gt; largest:
          largest = fval
      elif smallest is None:
          smallest = fval
      elif fval &lt; smallest :
          smallest = fval
  
  
  print("Maximum is",largest)
  print("Minimum is ",smallest)
  </code></pre>
  
  <pre><code>it is giving error Traceback (most recent call last):
    File "hw_ch_5_2.py", line 12, in &lt;module&gt;
      if fval &gt; largest:
  TypeError: '&gt;' not supported between instances of 'int' and 'NoneType'
  </code></pre>