b is in a
Similarly, the “not in” operator checks whether a specified value is not present in an object.
# Python Membership Operator
a = list((1, 2, 3, 4))
b = 3
if b not in a:
print("b is not in a")
else:
print("b is in a")
The program will output the following:
b is in a








































0 Comments