第一个爬虫和测试:完善球赛程序,测试你写的球赛程序,所有函数的测试结果
def GameOver(N, scoreA, scoreB):
'''
function: 定义一局比赛的结束条件
N: 代表当前局次(第五局为决胜局)
return: 若比赛结束的条件成立返回真,否则为假
'''
if N <= 4:
return (scoreA>=25 and abs(scoreA-scoreB)>=2 or scoreB>=25 and abs(scoreA-scoreB)>=2)
else:
return (scoreA>=15 and abs(scoreA-scoreB)>=2) or (scoreB>=15 and abs(scoreA-scoreB)>=2)
try:
for i in range(10):
a,b,c=map(int,input().split(','))
print(GameOver(a,b,c))
except:
print("error")
浙公网安备 33010602011771号