Commit af4483c1 by BellCodeEditor

save project

parent e12b8870
Showing with 15 additions and 6 deletions
total = [] def mysum(list):
def new_input(unit): sum=0
return int(unit) for n in list:
while True: sum+=n
return sum
def new_input():
total = []
while True:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q': if unit== 'q':
break break
...@@ -12,4 +19,6 @@ while True: ...@@ -12,4 +19,6 @@ while True:
print("使用有误") print("使用有误")
else: else:
total.append(unit) total.append(unit)
print(total) print(mysum(total))
\ No newline at end of file
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