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():
total = []
while True:
......@@ -6,6 +5,19 @@ def a():
if unit== 'q':
break
else:
total.append(unit)
print(total)
a()
\ No newline at end of file
try:
unit=int(unit)
except:
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