This is my list and code:
x=[["hi hello"], ["this is other"],["this"],["something"],["this"],["last element"]]
for line in x:
y=x.index(line)
#code
The first time it gets "this", it works properly, but for the second time, it gets the index of the first "this" only!
How can I find the second occurrence of a string inside a list?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…