nested if statement in python simple example