Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore it.
This is the question I have tried many ways but unable to achieve min and max numbers. Please help me with the code:
largest = None
samllest = None
while True:
num = input("Enter Numbers:")
if num == 'done' :
break
else:
try:
n = int(num)
except:
print("Invalid Input")
done, use the built-insminandmaxto return the relevant numberslist.append()method - appends x to the end of the sequence