Ad
  • Custom User Avatar

    Comprehensions are used very commonly in real-life scenarios. It's even in the google style guide to use them when the expressions are not overly complicated.

    Lambda function are a different story, though. While lambdas are commonly used for simple functions, you wouldn't normally use them as many of the solutions do here. Creating a lambda function and then assigning it to a variable sort of defeats the purpose of a lambda function unless you're using it to nest functions, and even then you'd only do that for very simple functions. However, most people on codewars just use them to reduce the number of lines in their code.