Correct Way To Create A Lambda Function Python