On 17/09/16 00:08, Sharon Wallace wrote:
> largest = None
> smallest = None
> while True:
>     num = raw_input('Enter a number:  ')
>     if num = 'done' : break

should use == to test equality a single = is
an assignment and would give an error here

         print num
         try :
             num = float(inp)
         except :

Don't use a bare except here, specify the error,
otherwise you potentially miss a lot of useful
debug information. Specifically you want to
catch ValueError here.

             print 'Invalid input'

       if largest is None or num > largest :
          largest = num
       if smallest is None or num < smallest :
          smallest = num

> print 'Maximum is:', largest
> print 'Minimum is:', smallest

Fix those errors and it should work

Alan G
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:

Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:

Reply via email to