list1 = [1,2,'a','b',5,67,78,99,"ji"] list2 = [1,"a","b",2,87,34,67,"ji"] for i in range(len(list1)): for j in range(len(list2)): if list1[i] == list2[j]:#元素相等时 print("yes") print("i:",i) print("j:",j) print("\n") elif list1[i] != list2[j]:#元素不相等时 print("no") print("s:",i) print("h:",j)