Commit 73ce649f by BellCodeEditor

auto save

parent d22343ac
Showing with 21 additions and 0 deletions
def price():
jiage = []
while True:
danjia = input("请输入价格")
try:
if danjia == 'p':
break
else:
jiage.append(int(danjia))
except:
input("请输入整数")
print(jiage)
return jiage
def sum(money):
count = 0
for i in money:
count = count + i
return count
x=sum(price())
print(x)
\ 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