Commit 472a6f42 by BellCodeEditor

auto save

parent 55905ede
Showing with 12 additions and 3 deletions
def eds123 def eds123():
total = [] total = []
while True: while True:
unit=input("请输入:") unit=input("请输入:")
...@@ -10,6 +10,15 @@ def eds123 ...@@ -10,6 +10,15 @@ def eds123
except: except:
print("请输入一个数字") print("请输入一个数字")
return total return total
def sum(list1):
sum=0
for i in list1:
sum=sum+i
return sum
list1=eds123() list1=eds123()
print(list1) s=sum(list1)
\ No newline at end of file print("共消费了:"+str(s)+"元")
\ 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