Using If In Lambda Function In Python For Loop