嗨,有人可以阐明在Python中使用"in"运算符的机制.
我现在正在处理以下示例:
print ('a' not in ['a', 'b']) # outputs False
print (not 'a' in ['a', 'b']) # outputs False -- how ???
print ('c' not in ['a', 'b']) # outputs True
print (not 'c' in ['a', 'b']) # outputs True
print (not 'a') # outputs False
# ok is so then...
print (not 'a' in ['b', False]) # outputs True --- why ???
Run Code Online (Sandbox Code Playgroud)
我现在很奇怪它是如何如此.如果有人知道,请分享您的知识.谢谢=)