[Baypiggies] ‘Maximum is None and the ‘Minimum is None’

Joshua Rodman jrodman at baypiggies.spamportal.net
Thu Jul 9 00:57:02 CEST 2015


On Wed, Jul 08, 2015 at 10:26:37PM +0000, admin.dslcomputer at gmail.com wrote:
> Hi Everyone:
> 
> 
> When the user enters a series of number integers, the output reads:  ‘Maximum is None and the ‘Minimum is None’
> 
> 
> What is the source of the syntax Error, below:
> 
> 
> largest = None
> smallest = None
> while True:
>     num = raw_input("Enter a number: ")
>     if (num == "done") : break
>     try: 
>         value = float(num)
>     except ValueError:
>         print "Invalid input"
>     continue  

This 'continue' line is not indendent, so the rest of the loop never
runs.

>     if smallest is None:
>         smallest = value
>     elif value < smallest:
>   smallest = value

Also this line is not correctly indented, so it will not work right
either.

>     print smallest, value
>     if largest is None:
>         largest = value
>     elif value > largest:
>         largest = value
>     print largest, largest
> print "Maximum is", largest
> print "Minimum is", smallest
> 
> 
> 
> 
> 
> 
> Regards,
> 
> Hal
> 
> 
> Sent from Surface

> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> https://mail.python.org/mailman/listinfo/baypiggies


-- 
JRod -- Splunk Supportability Engineering
    _
   /^\  
   |-|  
   | |  Blast off to
   |S|    Powerful Data
   |P|     Analysis!!!1
   |L|
   |U|   Splunk: Earth, 
  /|N|\    And beyond.
 / |K| \
|  | |  |
 `-"""-`


More information about the Baypiggies mailing list