Commit c2e82b70 by BellCodeEditor

save project

parent bf497174
Showing with 19 additions and 12 deletions
......@@ -2,16 +2,23 @@ def xkjnj():
total = []
while True:
i=input("请输入:")
if unit== 'q':
if i== 'q':
break
else:
total.append(unit)
print(total)
try:
xkjnj()
except:
print('请输入整数')
else:
total.append(i)
print(total)
return total
\ No newline at end of file
try:
i=int(i)
except:
print('请输入整数')
else:
total.append(i)
print(total)
return total
y =xkjnj()
def sum(c):
cun=0
for i in c:
cun=cun+i
print(cun)
return cun
sum(y)
\ 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