Commit a3635537 by BellCodeEditor

save project

parent f9223ad8
Showing with 17 additions and 4 deletions
def hello(name)
\ No newline at end of file
def mom_input(): def new_input():
total = [] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入:")
...@@ -13,5 +13,16 @@ def mom_input(): ...@@ -13,5 +13,16 @@ def mom_input():
total.append(unit) total.append(unit)
print('-'*30) print('-'*30)
return total return total
a=mom_input() a=new_input()
print(a) print(a)
\ No newline at end of file
def sum(money):
count=0
for i in money:
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