这可能是一个愚蠢的问题,但为什么这段代码表现得像这样呢?
>>> test = ['aaa','bbb','ccc'] >>> if 'ddd' or 'eee' in test: ... print True ... True >>>
我期待stdio上没有打印任何内容,因为IF语句中的所有字符串都不在列表中.
我错过了什么吗?
python list
list ×1
python ×1