Commit d15041d9 by BellCodeEditor

save project

parent dc70412a
Showing with 22 additions and 0 deletions
def sb():
total = []
try:
while True:
unit=int(input("请输入价格(按q键停止):"))
total.append(unit)
except:
print('输入错误,请输入一个价格')
else:
print("%"*50)
print(total)
return total
def sum(fb):
count = 0
for i in fb:
count = count + i
print(count)
nb = sb()
sum(nb)
\ 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