Commit ceba29d3 by BellCodeEditor

auto save

parent 472a6f42
Showing with 3 additions and 12 deletions
def eds123(): def eds123():
total = [] total = []
while True: while True:
unit=input("请输入:") unit=input("请输入:")
if unit== 'q': if unit== 'q':
...@@ -10,15 +10,6 @@ def eds123(): ...@@ -10,15 +10,6 @@ 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()
s=sum(list1) print(list1)
print("共消费了:"+str(s)+"元") \ No newline at end of file
\ 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