Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
今日、Python を書いているときに、不等式演算子をa!=borとして記述できることに気付きましたnot a==b。これは私に興味をそそられました:
a!=b
not a==b
==
__eq__()
!=
__ne__()
not ==
括弧に注意してください。
>>> not "test" == True True >>> not "test" and True False
==よりも優先されnotます。しかしnot、andと の優先順位は同じなので、
not
and
Python 演算子の優先順位