Commit eb6245a6 by BellCodeEditor

auto save

parent 570259a4
Showing with 11 additions and 8 deletions
...@@ -4,12 +4,15 @@ def new_input(): ...@@ -4,12 +4,15 @@ def new_input():
unit= input("请输入:") unit= input("请输入:")
if unit== 'q': if unit== 'q':
break break
try: else:
try:
unit = int(unit)
except:
print("输入错误,请输入数值!")
else: else:
total.append(unit) total.append(unit)
except: finally:
print("输入错误,请输入数值!") print("*"*20)
print(total)
return total return total
rezult = new_input() result = new_input()
\ No newline at end of file print(result)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment