Can you explain me the “-1” after che t i.find(“&”)?

Hi noispaxen.

I hope you can help me a little bit.

‘thread_sold_split =
for i in thread_sold:
if i.find(“&”) == -1:
thread_sold_split.append(i)
else:
b = i.split(“&”)
for c in b:
thread_sold_split.append(c)’

In this code that you wrote, can you explain me the “-1” after che t i.find(“&”)? Why have you put that one? In that case i prefered to write this, although, I believe that It is not right.

‘thread_sold_split =
for x in thread_sold:
for i in x:
if “&” not in i:
thread_sold_split.append(i)
elif “&” in i:
thread_sold_split.append(i.split(“&”))
print(thread_sold)’

Thank you for you time!

2 posts were merged into an existing topic: Don’t really grasp where does the difference come from?