Commit 443b11ed by BellCodeEditor

save project

parent e7691824
Showing with 8 additions and 15 deletions
...@@ -2,7 +2,7 @@ def store(): ...@@ -2,7 +2,7 @@ def store():
total = [] total = []
while True: while True:
money = input("请输入(q退出):") money = input("请输入(q退出):")
if money == 'q': if money == 'q'
break break
else: else:
try: try:
...@@ -13,13 +13,5 @@ def store(): ...@@ -13,13 +13,5 @@ def store():
total.append(money) total.append(money)
print("滚"*30) print("滚"*30)
return total return total
price = store() return = store()
print(result)
def sum(money):
count = 0
for i in money:
count = count + i
return count
pay = sum(price)
print("你一共消费" + str(pay) + "元!扫码还是付现金呢?")
\ No newline at end of file
import func import func
import func import func
a=func.store() a=func.store()
\ No newline at end of file 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