syntax for nested if else in pythonの検索結果