Commit 533e976a by BellCodeEditor

save project

parent 26190cbc
Showing with 11 additions and 4 deletions
...@@ -7,8 +7,15 @@ def new_input(): ...@@ -7,8 +7,15 @@ def new_input():
try: try:
unit = int(unit) unit = int(unit)
except: except:
print('请输入一个数字:') print(unit)
else: else:
total.append(unit) total.append(unit)
print(total) return total
new_input() #print(new_input())
\ No newline at end of file def func(data):
sum1 = 0
for i in data:
sum1 += i
return sum1
data = new_input()
print(func(data))
\ 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