5
很奇怪地看到使用“在乙方对str中”语法的一段代码,如:Python字符串在...语法
>>> 'test' in 'testtest' in 'testtesttest'
True
>>> 'test' in 'testtest' in 'tb3'
False
>>> 'test' in 'testtesta' in 'testtesttest'
False
>>> 'test' in ('testtest' in 'testtesttest')
Traceback (most recent call last):
File "<input>", line 1, in <module>
'test' in ('testtest' in 'testtesttest')
TypeError: argument of type 'bool' is not iterable
看来“在......在.. ''与'< ... < ...'比较类似。但一个快速谷歌并没有引导我到正式的答案。任何帮助?从Python documentation
我想你的猜测是正确的。 “C中B中的A”表示“A中B和B中C”,就像“a Organis