Commit d43d8db4 by BellCodeEditor

save project

parent db7dbbb0
def sum(money):
count=0
for i in money:
count=count+i
return count
\ No newline at end of file
import func
data=func.a()
score=func.sum(a)
\ No newline at end of file
def a(): def a():
total = [] total = []
while True: while True:
...@@ -6,6 +5,19 @@ def a(): ...@@ -6,6 +5,19 @@ def a():
if unit== 'q': if unit== 'q':
break break
else: else:
total.append(unit) try:
print(total) unit=int(unit)
a() except:
\ No newline at end of file print("整数")
else:
total.append(unit)
return total
def sum(money):
count=0
for i in money:
count=count+i
return count
price=a()
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