syntax for nested if in pythonの検索結果