title: Getting minimum and maximum from inputs
body: <p><a href="https://i.stack.imgur.com/iLBIQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iLBIQ.jpg" alt="Coursera python assignment" /></a></p>
  <p>I do not inderstand what is wrong with this code.  It works well for the largest, but not the smallest. And both line of codes are the same!
  I am new here and new to programming as well, pardon my inexperence . Please note that I need to solve this problem with these methodes as it was the chapter in the course. Sorry again</p>
  <pre><code>largest = None
  smallest = None
  while True:
      num = input(&quot;Enter a number: &quot;)
      if (num==&quot;done&quot;): 
          break
      else:
          try:
              num=int(num)
          except:
              print(&quot;Invalid input&quot;) 
              continue
      if(num &lt; smallest):
          smallest = num
      elif(num &gt; largest):
          largest = num
  print(&quot;Maximum is&quot;, largest)
  print(&quot;Minimum is&quot;, smallest)
  </code></pre>