python怎么對比兩個數據庫之間的相同項?
先把兩組數據的字符串全部轉為小寫,然后用列表推導式: list1 = [i.lower() for i in list1] list2 = [i.lower() for i in list2] list3 = [i for i in list1 for j in list2 if i==j]
python怎么對比兩個數據庫之間的相同項?
先把兩組數據的字符串全部轉為小寫,然后用列表推導式: list1 = [i.lower() for i in list1] list2 = [i.lower() for i in list2] list3 = [i for i in list1 for j in list2 if i==j]