Commit 888e4506 by BellCodeEditor

save project

parent 7eaed43a
def sum(money):
count = 0
for i in money:
count += i
return count
#print(sum([1,2,3,4]))
list = [1,2,3]
print(sum(list))
import func
import bhj
data = func.new_input()
score = bhj.sum(data)
print("这位选手的总分数为:"+str(score))
try:
age = ing(input('你今年几岁了'))
except:
print('要输入整数啊')
print('程序结束')
\ No newline at end of file
def new_input():
total = []
while True:
unit= input("请输入(q退出):")
if unit== 'q':
break
else:
try:
unit = int(unit)
except:
print("请重新输入一个数字")
else:
total.append(unit)
print("_"*30)
return total
result = new_input()
print(result)
\ 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