Commit 775bf4d4 by BellCodeEditor

auto save

parent 725bb92e
Showing with 10 additions and 3 deletions
...@@ -5,9 +5,15 @@ def new_input(): #先 封装函数 ...@@ -5,9 +5,15 @@ def new_input(): #先 封装函数
if unit== 'q': if unit== 'q':
break break
else: else:
total.append(unit) try:
unit=int(unit)#float
except:
print("需要填入数字。")
else:
total.append(unit)
return tatol
print(total) print(total)
#无参 #后 调用函数 #无参 #后 调用函数
new_input() result=new_input()
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