title: "None" cannot be compared with numbers. Any other alternatives?
body: <p>In Python 2, you could compare None with integers and floating point numbers in solutions as finding the smallest number by comparing. But in Python 3 they are not able to be compared. Do you have any alternative keywords or solutions for this in Python 3?</p>
  
  <pre><code>TypeError: '&gt;' not supported between instances of 'int' and 'NoneType'
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre class="lang-py prettyprint-override"><code>l = None
  s = None
  
  while True:
      n = input("Enter a number: ")
      if (n == "done") :
          break
      try:
          num = int(n)
      except:
          print ("Invalid input")
          continue
      if (s is None):
          s = num
      if (num &gt; l) :
          l = num
      elif (num &lt; s) :
          s = num
  
  def done(l,s):
      print ("Maximum is", l)
      print ("Minimum is", s)
  
  done(l,s)
  </code></pre>