Commit 0830b353 by BellCodeEditor

save project

parent 05e7d622
Showing with 28 additions and 0 deletions
def sb():
total = []
try:
while True:
unit=int(input("请输入价格(按q键停止):"))
total.append(unit)
except:
print('输入错误,请输入一个价格')
else:
pass
return total
def sum(fb):
count = 0
for i in fb:
count = count + i
#print('您一共消费了'+str(count)+'元!扫码还是现金呢?')
nb = sb()
sum(nb)
\ No newline at end of file
import func
data = sb()
score = sum(data)
print('这位选手的总分数为'+str(score)+'分')
\ 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