Commit d3ba4937 by BellCodeEditor

save project

parent 25912088
Showing with 14 additions and 12 deletions
total = []
def new_price(a):
def new_price():
while True:
unit= input("请输入:")
if unit== 'q':
......@@ -8,21 +8,23 @@ def new_price(a):
else:
try:
unit=int(unit)
a.append(unit)
except:
print("程序错误")
break
else:
total.append(unit)
return total
w=new_price(total)
def sum(list)
b=0
for i in list():
b+=i
return list
c=sum(total)
a = new_price()
print(a)
def sum(list):
b=0
for i in list:
b+=i
return b
c=sum(a)
print(c)
# print(total)
s=new_price(total)
print(s)
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