# Exercise 5.1: Write another program that prompts for a list of numbers as
# above and at the end prints out both the maximum and minimum of the numbers
# instead of the average.

largest = None
smallest = None
while True:
    num = input("Enter a number: ")
    if num == "done" :
        break
    try:
        fnum = int(num)
        if largest is None:
            largest = fnum
        if fnum > largest:
            largest = fnum
        if smallest is None:
            smallest = fnum
        if fnum < smallest:
            smallest = fnum
    except:
        print('Invalid input')

print("Maximum is", largest)
print("Minimum is", smallest)

f8014df3f7e6a47399ca5e3c94f56a428a5335e9
<mask token>

<mask token>
while True:
    num = input('Enter a number: ')
    if num == 'done':
        break
    try:
        fnum = int(num)
        if largest is None:
            largest = fnum
        if fnum > largest:
            largest = fnum
        if smallest is None:
            smallest = fnum
        if fnum < smallest:
            smallest = fnum
    except:
        print('Invalid input')
print('Maximum is', largest)
print('Minimum is', smallest)

largest = None
smallest = None
while True:
    num = input('Enter a number: ')
    if num == 'done':
        break
    try:
        fnum = int(num)
        if largest is None:
            largest = fnum
        if fnum > largest:
            largest = fnum
        if smallest is None:
            smallest = fnum
        if fnum < smallest:
            smallest = fnum
    except:
        print('Invalid input')
print('Maximum is', largest)
print('Minimum is', smallest)

# Exercise 5.1: Write another program that prompts for a list of numbers as
# above and at the end prints out both the maximum and minimum of the numbers
# instead of the average.

largest = None
smallest = None
while True:
    num = input("Enter a number: ")
    if num == "done" :
        break
    try:
        fnum = int(num)
        if largest is None:
            largest = fnum
        if fnum > largest:
            largest = fnum
        if smallest is None:
            smallest = fnum
        if fnum < smallest:
            smallest = fnum
    except:
        print('Invalid input')

print("Maximum is", largest)
print("Minimum is", smallest)
