Commit eb6245a6 by BellCodeEditor

auto save

parent 570259a4
Showing with 9 additions and 6 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: else:
total.append(unit) try:
unit = int(unit)
except: except:
print("输入错误,请输入数值!") print("输入错误,请输入数值!")
else:
print(total) total.append(unit)
finally:
print("*"*20)
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