syntax for nested if in python