I do not inderstand what is wrong with this code. It works well for the largest, but not the smallest. And both line of codes are the same! I am new here and new to programming as well, pardon my inexperence . Please note that I need to solve this problem with these methodes as it was the chapter in the course. Sorry again
largest = None
smallest = None
while True:
num = input("Enter a number: ")
if (num=="done"):
break
else:
try:
num=int(num)
except:
print("Invalid input")
continue
if(num < smallest):
smallest = num
elif(num > largest):
largest = num
print("Maximum is", largest)
print("Minimum is", smallest)