Commit 018f718b by BellCodeEditor

save project

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