自己有2段python for in range code(下面), 因為速度問題, 研究python list comprehension, 搵左好耐資料同埋諗左耐都寫唔出, 醒起可以問BING CHAT, BING CHAT幾秒就寫左句野出黎 list4 = [list3[list2.index(txt)] if txt in list2 else None for txt in list1] , 我測過結果, 同下面一樣。
===============
for i in range(10000):
txt=list1[i]
for c in range(150000):
if txt==list2[c]:
list4[i]=list3[c]
break
=============== |