Commit 403da0e5 by BellCodeEditor

save project

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