您好,我一直很困惑,为什么我已经定义了名称A,但为什么如此?
def occurInBoth(A,B):
occured = 0
for i in range(len(A)):
if B[i] == A[i]:
occured += 1
return occured
occured = occurInBoth(A,B)
A = [5,12,31,7,25]
B = [4,12,31,7,42,8]
print(occured)
A = [5,12,31,7,25]
B = [4,12,31,7,42,8]
occured = occurInBoth(A,B)
print(occured)