For Loop And If Else Condition In Python