Largest-Smallest No

mail@pastecode.io avatar
unknown
python
2 years ago
430 B
5
Indexable
Never
largest=None
smallest=None

while True:
    num=input("Input the integer value only!")
    try:
        num=int(num)
    except:
        print("Invalid input")
    if num is None :
        largest= None
        smallest= None
    elif num < smallest :
        smallest= num
    elif num > largest :
        largest=num
    elif num== "done" :
        break
print("Maximum", largest)
print("Minimum", smallest)