syntax of nested if else statement in python