Commit 018f718b by BellCodeEditor

save project

parent 8692c34c
Showing with 10 additions and 8 deletions
try: def new_input():
def new_input():
total = [] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入:")
...@@ -8,8 +7,12 @@ try: ...@@ -8,8 +7,12 @@ try:
else: else:
total.append(int(unit)) total.append(int(unit))
print(total) print(total)
new_input() return total[0]
return total q=new_input()
print(total) def sum(d):
except: f=0
print('输入整数') for i in d:
\ No newline at end of file f=f+i
return f
print(sum(q))
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