i have created this code which would take the input from the user and remove the largest and the smallest number from the input but it doesn't seem to work. I do get the largest value but not the minimum one. Please help.
largest = None
smallest = None
inp = raw_input("Enter a number: ")
#Cases if inp == "done" : break #Work over here try: num = int(inp) except: print "Invalid input" continue if smallest is None: smallest = num elif num < smallest: smallest = num if largest is None: largest = num elif num > largest: largest = num
print "Maximum is", largest
print "Minimum is", smallest