Commit 3e352139 by BellCodeEditor

save project

parent 05e7d622
Showing with 30 additions and 0 deletions
def get_list():
total = []
while True:
s = input('请输入:')
if s == 'q':
break
try:
price = int(s)
except:
print('请输入数字')
else:
total.append(price)
return total
def sum(lis):
sum = 0
for i in lis:
sum += i
return sum
import demo01
lis = demo01.get_list()
toltal = demo01.sum(lis)
print(toltal)
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