Commit 7adc9884 by BellCodeEditor

save project

parent 30564493
Showing with 18 additions and 7 deletions
...@@ -2,7 +2,7 @@ def new_inpot(): ...@@ -2,7 +2,7 @@ def new_inpot():
total = [] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q' if unit== 'q':
break break
else: else:
...@@ -11,12 +11,23 @@ def new_inpot(): ...@@ -11,12 +11,23 @@ def new_inpot():
except: except:
print("sb") print("sb")
else: else:
total.append(unit) total.append(unit)
finally: finally:
print("-"*30) print("-"*30)
return total return total
result=new_inpot()
print(result) count=0
def sum(money):
count=0
for i in money:
count=count+i
return count
price=new_inpot()
sum(price)
pay=sum(price)
print("花了"+str(pay)+"元")
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