title: Need to find largest and smallest values from user input
body: <p>Input may contain strings as well but the code should continue, input is 7,2, bob, 10, 4</p>
  
  <p>Need help to find largest and smallest from user input data and current code is only printing last entry</p>
  
  <pre><code>largest = None
  smallest = None
  
  while True:
      num = input("Enter a number: ")
      if num == "done" : break
      try:
          num = int(num)
      except:
          print ("Invalid input")
  
  if largest is None:
      largest = num
  elif num &gt; largest:
      largest = num
  
  if smallest is None:
      smallest = num
  elif num &lt; smallest:
      smallest = num
  
  
  print("Maximum is", largest)
  print ("Minimum is", smallest)
  </code></pre>