Sep-05-2020, 11:20 PM
I guess to say "can't" is a little bit strong. Python does have lambda expressions, but they can only be a single expression rather than everything that can be placed into a (named) function.
>>> squareit = lambda x: x**2 # no name, but assigned to squareit >>> print(squareit(5)) 25But because of the limitations, I think of them as a separate category from python functions.