() → not → and → or の順に計算する。
()
not
and
or
Pythonによる2重ループから抜け出す方法を現役エンジニアが解説【初心者向け】 | TechAcademyマガジン
Pythonで多重ループ(ネストしたforループ)からbreak | note.nkmk.me