Python3 の集合の検査も not item in dist でも item not in dict でも動くようだ
2021-08-12


昨日の not in dict の実験の続き。昨日は Python 2 系で試してしまったので、今日は同じ内容を python3 で。

python3 で試したが、結果は全く同じ。

% python3
Python 3.7.9 (default, Feb 28 2021, 01:41:41)
[Clang 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c
on freebsd13
Type "help", "copyright", "credits" or "license" for more information.
>>> a = { "a" : "A" }
>>> print( a[ "a" ] )
A
>>> print( "a" in a )
True
>>> print( "a" not in a )
False
>>> print( not "a" in a )
False
>>>

前回

[FreeBSD]
[Programming]
[python]

コメント(全0件)
コメントをする


記事を書く
powered by ASAHIネット