Commit 9407c052 by BellCodeEditor

save project

parent 634e4bea
Showing with 14 additions and 4 deletions
...@@ -11,5 +11,15 @@ def new_input(): ...@@ -11,5 +11,15 @@ def new_input():
print("请重新输入一个数字") print("请重新输入一个数字")
else: else:
total.append(unit) total.append(unit)
print(total) print("-"*30)
new_input() return total
\ No newline at end of file
a=new_input()
def sum(d):
s=0
for i in d:
s=s+i
print(s)
new_input()
sum(a)
\ No newline at end of file
...@@ -9,7 +9,7 @@ def new_input(): ...@@ -9,7 +9,7 @@ def new_input():
unit=int(unit) unit=int(unit)
except: except:
print("请重新输入一个数字") print("请重新输入一个数字")
else: else:
total.append(unit) total.append(unit)
return total return total
a=new_input() a=new_input()
......
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