How can I rewrite this code that uses a lambda function in python; without using the lambda function.
In other words, I want to do something like this;