Commit 09c9039e by BellCodeEditor

save project

parent 05e7d622
import func
data=func.new()
nnn=func.sum(data)
print("这位选手的总分是"+str(nnn)+"分")
\ No newline at end of file
def new():
total=[]
while True:
u= input("请输入:")
if u== 'q':
break
else:
try:
u=int(u)
except:
print("wrong,again!")
else:
total.append(u)
finally:
print("-"*30)
return total
#print(re)
def sum(money):
count=0
for u in money:
count=u+count
return count
#re = new()
#tttt=sum(re)
#print("您一共消费了"+str(tttt)+"元!扫码还是现金?")
\ 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