Oct-22-2020, 11:57 AM
I expect that this is what you are looking for:
Also, use specific except condition, or others will be ignored.
while True: num = input("Enter a number: ") if num == "done": break try: n = int(num) except ValueError: print('Invalid input') continue if n > l: l = n if n < s: s = nNote: it is recommended that conditions go on one line, and solution indented underneath.
Also, use specific except condition, or others will be ignored.