Commit 25dd076a by BellCodeEditor

save project

parent 05e7d622
import func
a = func.new_input()
n=func.sum(a)
print("这位选手得了"+str(n)+"分")
def new_input():
total = []
while True:
unit = input("请输入:")
if unit=='q':
break
else:
try:
unit = int(unit)
except:
print("输入错误")
else:
total.append(unit)
#print("-"*30)
return total
#aa=new_input()
def sum(t):
count = 0
for i in t:
count = count+i
return count
#pay = sum(aa)
#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