Https Leetcode Com Problems Nested If Function Python Syntax