Commit 7a78ea8c by BellCodeEditor

save project

parent 82eb6ff5
Showing with 10 additions and 1 deletions
......@@ -2,7 +2,7 @@ def new_input():
total = []
while True:
money= input("请输入:")
if unit== 'q':
if money== 'q':
break
else:
try:
......@@ -17,3 +17,11 @@ def new_input():
return total
result=new_input
print(result)
def sum(unit):
count=0
for i in unit:
count=count+i
return count
price=new_input()
pay=sum(price)
print("您一共消费了"+str(pay)+"元")
\ 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