In Python, I am trying to create an if statement that proceeds if one variable of one array exists somewhere in another list or array. Here is my basic code, which is supposed to check if any of the values within ids
exist in follow_num
:
ids = [123,321,111,333]
follow_num = [111, 222]
if any(ids == follow_num):
print(ids)
Despite my best attempts, and many versions of the above, I cannot get this to work. Could someone please elaborate where I am going wrong here?