I am trying to write a lambda function first time in python. Please help with reviewing this code and suggest to make it better. (Including possible error handling, use of J