Commit 02df8a6b by BellCodeEditor

save project

parent 73109b19
Showing with 9 additions and 4 deletions
total = [] def new_input():
while True: total = []
while True:
un=input("请输入:") un=input("请输入:")
if un == 'q': if un == 'q':
break break
...@@ -9,4 +10,8 @@ while True: ...@@ -9,4 +10,8 @@ while True:
print('只可以输入数字哦') print('只可以输入数字哦')
else: else:
total.append(unit) total.append(unit)
print(total) print(total)
\ No newline at end of file print('-'*30)
return total
print('-'*30)
print('结果'+str(sum(new_input())))
\ 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