Jul-30-2019, 05:02 PM
(This post was last modified: Jul-30-2019, 05:29 PM by ichabod801.)
largest = None smallest = None while True: nums = input("Enter a number: ") if nums == "done": break try: num = int(nums) except: print("Invalid input") continue if largest is None or largest < num: largest = num elif smallest is None or smallest > num: smallest = num #except ValueError: #print("Invalid input") print ("Maximum is", largest) print ("Minimum is", smallest)