python for everybody chapter 5 2 assignment

Solutions on MaxInterview for python for everybody chapter 5 2 assignment by the best coders in the world

showing results for - "python for everybody chapter 5 2 assignment"
Marianna
05 Sep 2017
1num = 0
2largest = -1
3smallest = None
4while True:
5    num = input("Enter a number: ")
6    if num == "done" :
7        break
8    try :
9        numb = int(num)
10    except :
11        print('Invalid input')
12    if smallest is None :
13        smallest = numb
14    elif numb < smallest :
15        smallest = numb
16    elif numb > largest :
17        largest = numb
18print("Maximum is", largest)
19print("Minimum is", smallest)
20