gpt4 book ai didi

Python 评估顺序

转载 作者:太空狗 更新时间:2023-10-30 01:45:23 24 4
gpt4 key购买 nike

<分区>

这是代码,我不太明白,它是如何工作的。谁能告诉我,这是预期的行为吗?

$ipython

In [1]: 1 in [1] == True
Out[1]: False

In [2]: (1 in [1]) == True
Out[2]: True

In [3]: 1 in ([1] == True)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)

/home/dmedvinsky/projects/condo/condo/<ipython console> in <module>()

TypeError: argument of type 'bool' is not iterable

In [4]: from sys import version_info

In [5]: version_info
Out[5]: (2, 6, 4, 'final', 0)

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com