代码示例:(标识:python_oper_membership_2)
python_oper_membership_2.py
x = ["apple", "banana"]

print("pineapple" not in x)

# returns True because a sequence with the value "pineapple" is not in the list
运行结果: