我是 python 的初学者,我有一个任务,winner_round 函数比较两个列表,并计算在游戏中有多少轮亚当的球队得分比对手多。如果两个列表不匹配,则返回 -1 这是我的代码:
def winner_round(list1,list2):
list1 = [30, 50, 10, 80, 100, 40]
list2 = [60, 20, 10, 20, 30, 20]
point = 0
for i in winner_round(list1,list2):
if list1>list2:
return -1
print(-1)
for pointA in list1:
for pointE in list2:
if pointA > pointE:
point+=1
break
return(point)
print(point)
对不起我的英语不好