I know that the in
operator can be used in Python as a short-hand of the following (generally speaking, not considering any hidden equality issues or anything):
for item in list1:
if item == thingToCheck:
return True
return False
However, I was wondering about the technical meaning of in
in the actual for item in list1
line- obviously there is another meaning to in
, since Python wouldn't generate every single possible value of item
and see if item in list1
. On a related note, are Python for
loops ever made without in
?