while True :
try:
prompt = input('Enter a number: ')
promptval = int(prompt)
if prompt == 'done':
break
print("Maximum is ",max(promptval))
print("Minimum is ",min(promptval))
except ValueError:
print('Invalid input')
continue
提示输入项“完成”给出“无效输入”