title: Filtering Data outside of a range using python shell
body: <p>I'm attempting to write a program that lets the user input a list of numbers and tell them maximum and minimum numbers. The program should let the user choose the allowable minimum and maximum values, and should not let the user input something to the list that is outside of these bounds. I've managed to get the first bit done but I have no idea how to filter data outside of a range. Help would be greatly appreciated.</p>
  
  <pre><code>print ("Input done when finished")
  print ("Input thresholds")
  
  maximumnum = int(input("Input maximum number: "))
  minimumnum = int(input("Input minimum number: "))
  
  
  minimum = None
  maximum = None
  
  while True:
      inp =input("Enter a number: ")
      if inp == "done": 
      break
  
      try:
          num = float(inp)
      except:
          print ("Invalid input")
          continue                            
  
      if minimum is None or num &lt; minimum:
          minimum = num
  
      if maximum is None or num &gt; maximum:
          maximum = num
  
  print ("Maximum:", maximum)
  print ("Minimum:", minimum)
  </code></pre>