Commit 483c83d3 by BellCodeEditor

save project

parent ec523edc
total=[]
def d():
while True:
tunit=input("请输入:")
if tunit == 'q':
break
else:
try:
tunit=int(tunit)
except:
print("请输入整数")
else:
total.append(tunit)
print("已经加入")
print(total)
return total
u=d()
def sum(cun):
can=0
for i in cun:
can=can+i
return can
y=sum(u)
print(y)
\ No newline at end of file
import func
t=func.d()
w=func.sum(t)
print(w)
\ 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