Using If In Lambda Function In Python Syntax For Loop