Commit 32baed38 by BellCodeEditor

save project

parent f31eac19
Showing with 12 additions and 2 deletions
def price():
total=[]
while True:
unit=(input())
unit=input()
if unit=="q":
break
else:
unit=int(unit)
total.append(unit)
print(total)
return price()
return total
try:
a=price()
......@@ -15,6 +16,15 @@ except:
print("数据类型错误")
else:
print(a)
def sum(i):
count=0
for f in i:
count=count+f
return count
b=sum(a)
b=str(b)
print("消费"+b)
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