上代码:
a = [2, 3, 3, 1, 1, 3, 3, 3, 2, 1, 3, 1, 3, 2, 2, 2, 3, 1, 2, 3, 2, 3, 1, 1, 2, 1, 1, 1, 2, 2, 3, 3, 2, 3, 1, 1, 3, 1, 2, 1, 2, 3, 3, 3, 2, 2, 3, 1, 2, 3, 1, 1, 2, 3, 2, 1, 2, 2, 2, 1, 1, 2, 2, 2, 3, 3, 2, 3, 2, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 3, 2, 2, 2, 2, 2, 3, 3, 1, 3, 3, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1] b = [2, 1, 1, 1, 1, 3, 3, 3, 2, 1, 3, 3, 3, 2, 2, 2, 3, 1, 2, 3, 2, 3, 1, 3, 2, 1, 1, 1, 2, 3, 3, 1, 2, 3, 1, 1, 1, 3, 2, 1, 2, 3, 3, 3, 2, 2, 3, 3, 2, 3, 1, 3, 2, 3, 2, 1, 2, 2, 2, 3, 1, 2, 2, 2, 3, 3, 2, 3, 2, 2, 3, 1, 1, 2, 1, 3, 1, 1, 3, 3, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 2, 1, 3, 1, 2, 1, 3, 3] import numpy as np a = np.array(a) b = np.array(b) sum(a==b) #个数为84