Commit 403da0e5 by BellCodeEditor

save project

parent 55541183
def sum(money): import func
count=0 data=func.a()
for i in money: score=func.sum(data)
count=count+i print(score)
return count
a=[45,55,65,75,85,95,105,115,125]
print(sum(a))
......
...@@ -5,19 +5,23 @@ def a(): ...@@ -5,19 +5,23 @@ def a():
if unit== 'q': if unit== 'q':
break break
else: else:
try:
unit=int(unit)
except:
print("整数")
else:
total.append(unit) total.append(unit)
print(total) finally:
return(totle) print("-"*30)
return total
def sum(money): def sum(money):
count=0 count=0
for i in money: for i in money:
count=count+i count=count+i
return count return count
a=[45,55,65,75,85,95,105,115,125] # price=a()
print(sum(a)) # pay=sum(price)
price=a() #print("您一共消费"+str(pay)+"元")
pay=sum(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