Commit 427dc39d by BellCodeEditor

auto save

parent dc70412a
Showing with 37 additions and 0 deletions
def new_input()
\ No newline at end of file
def new_input():
total = []
while True:
box = input("请输入————————\n一个整数!\n")
if box== 'q':
break
else:
try:
box = int(box)
except:
print('乡 思 是 不 是 ')
print('重来!')
else:
total.append(box)
print('下一个!')
print('-'*30)
#print(total)
return (total)
all=new_input()
print(all)
print('\n下一步 输出总值\n↓↓↓')
def count(xx):
count = 0
for i in xx:
count+=i
return (count)
all2 = count(all)
print ("→"+str(all2))
\ No newline at end of file
def count():
count = 0 #全局变量
for i in xxx:
count+=i
return (count)
\ 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