Commit 87342c93 by BellCodeEditor

auto save

parent 05e7d622
import func
result = func.l()
h = func.a(result)
print("这位人的总分为"+str(h))
\ No newline at end of file
def l():
total=[]
while True:
unit= input("请输入(q退出):")
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
print("请输入一个数字")
else:
total.append(unit)
finally:
print("-"*30)
return total
def a(m):
b=0
for i in m:
b = b + i
return b
def shd():
result = l()
g = a(result)
return g
#print("您一共消费了"+str(g)+"元!扫码还是现金")
\ 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