Commit 5ecfad31 by BellCodeEditor

save project

parent c7d1186a
def menu():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
money= input("请输入:")
if money== 'q':
break
else:
try:
unit=int(unit)
money=int(money)
except:
print('请输入一个整数')
else:
total.append(unit)
total.append(money)
finally:
print('*'*50)
return total
print(menu())
\ No newline at end of file
def sum(price):
a=0
for i in price:
a=a+i
return a
#pay=sum
#print('你一共消费了'+str(pay)+'元!扫码或者现金支付')
\ No newline at end of file
import func
a=func.menu()
b=func.sum(a)
print('这位选手的总分是:'+str(b))
\ 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