Let A
be a list of values and a
a string/value whose I occurrence in A
I want to check, is there a difference in speed or result between the two following versions?
A = [1, 2, 3]
a = 4
if a not in A:
print("a is not in A!")
if not a in A:
print("not a is in A!")
The Python docs on Expressions talk about the existence of the not in
operator. Does that mean the first version is more canonical?