Commit 08fbc133 by BellCodeEditor

save project

parent 5ed2ace3
Showing with 35 additions and 1 deletions
def NEW_PRINCE():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else :
try:
unit= int(unit)
except:
print ('请重新输入')
else:
total.append(unit)
finally:
print("-"*30)
print(total)
return total
def x_1(money):
y = 0
for i in money:
y = y + i
print(y)
return y
price=NEW_PRINCE()
pay = x_1(price)
print('您一共消费了'+str(pay)+'元!扫码还是现金呢')
......@@ -12,4 +12,12 @@ def NEW_PRINCE():
else:
total.append(unit)
return total
NEW_PRINCE()
def x(money):
y = 0
for i in money:
y = y + i
print(y)
return y
price=NEW_PRINCE()
pay = x(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