nested if statements in python example