Nested If Condition In Python