The question is "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 the number. Enter 7, 2, bob, 10, and 4 and match the output below."
My answer:
My answer:
largest = None smallest = None while True: num = input("Enter a number: ") largest=num smallest=num try: for values in [num]: if largest<float(num): largest=float(num) except: print("Invalid input") if num == "done" : break print("Maximum is",largest) print("Minimum is",smallest)It shows the code goes wrong from "except"