There are several different answers I can give here, from your specific question to more general concerns. So from most specific to most general:

Q. Can you put multiple statements in a lambda?

A. No. But you don't actually need to use a lambda. You can put the statements in a def instead. i.e.:

def second_lowest(l):
    l.sort()
    return l[1]

map(second_lowest, lst)

Q. Can you get the second lowest item from a lambda by sorting the list?

A. Yes. As alex's answer points out, sorted() is a version of sort that creates a new list, rather than sorting in-place, and can be chained. Note that this is probably what you should be using - it's bad practice for your map to have side effects on the original list.

Q. How should I get the second lowest item from each list in a sequence of lists?

A. sorted(l)[1] is not actually the best way for this. It has O(N log(N)) complexity, while an O(n) solution exists. This can be found in the heapq module.

>>> import  heapq
>>> l = [5,2,6,8,3,5]
>>> heapq.nsmallest(l, 2)
[2, 3]

So just use:

map(lambda x: heapq.nsmallest(x,2)[1],  list_of_lists)

It's also usually considered clearer to use a list comprehension, which avoids the lambda altogether:

[heapq.nsmallest(x,2)[1] for x in list_of_lists]
Answer from Brian on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_lambda.asp
Python Lambda
A lambda function is a small anonymous function. A lambda function can take any number of arguments, but can only have one expression. ... The power of lambda is better shown when you use them as an anonymous function inside another function.
Discussions

amazon web services - AWS Python Lambda with multiple functions - Stack Overflow
I have an AWS Lambda function in python3.7. The way its set up im running the lambda_handler(event, context) function and passing data to a separate function that calls itself multiple times depend... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Lambda and multiple statements in Python - Stack Overflow
You cannot put a statement inside a lambda, let alone multiple statements. ... To be more clear about what Bakuriu says, Python doc docs.python.org/3/reference/expressions.html#lambda also says "Note that functions created with lambda expressions cannot contain statements or annotations" ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
June 25, 2015
python - How to make multiple lambda functions with a function? - Stack Overflow
I want to make multiple lambda functions with different parameters and bind them to a dictionary. More on stackoverflow.com
๐ŸŒ stackoverflow.com
One Lambda function that does many things or One thing per lambda
One thing per lambda. You can use lambda layers for shared code between functions. More on reddit.com
๐ŸŒ r/aws
16
12
January 31, 2022
๐ŸŒ
Spark By {Examples}
sparkbyexamples.com โ€บ home โ€บ python โ€บ python lambda with multiple arguments
Python Lambda with Multiple Arguments - Spark By {Examples}
May 31, 2024 - Python lambda can be used with multiple arguments and these arguments are used in evaluating an expression to return a single value. A Python lambda
๐ŸŒ
Real Python
realpython.com โ€บ python-lambda
How to Use Python Lambda Functions โ€“ Real Python
June 14, 2025 - Decorating the lambda function this way could be useful for debugging purposes, possibly to debug the behavior of a lambda function used in the context of a higher-order function or a key function. Letโ€™s see an example with map(): ... The first argument of map() is a lambda that multiplies its argument by 2.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python-lambda-anonymous-functions-filter-map-reduce
Python Lambda Functions - GeeksforGeeks
Lambda functions do not allow multiple statements, however, we can create two lambda functions and then call the other lambda function as a parameter to the first function.
Published: December 11, 2024
Find elsewhere
๐ŸŒ
Guru99
guru99.com โ€บ home โ€บ python โ€บ python lambda functions with examples
Python Lambda Functions with EXAMPLES
July 10, 2026 - A Lambda Function in Python programming ... having no more than one line. Just like a normal function, a Lambda function can have multiple arguments with one expression....
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ lambda-function-in-python-example-syntax
Lambda Function in Python โ€“ Example Syntax
September 27, 2021 - You can also return a lambda function from a function. If you ever need to create multiple functions that multiply numbers, for example doubling or tripling and so on, lambda can help.
๐ŸŒ
CodeRivers
coderivers.org โ€บ blog โ€บ python-lambda-functions-multiple-arguments
Python Lambda Functions with Multiple Arguments: A Comprehensive Guide - CodeRivers
February 22, 2026 - In Python, lambda functions are a powerful and concise way to create small, anonymous functions. While they are often associated with single - argument functions, lambda functions can also accept multiple arguments. Understanding how to work with lambda functions that take multiple arguments ...
๐ŸŒ
LabEx
labex.io โ€บ tutorials โ€บ python-how-to-create-lambda-with-multiple-arguments-420053
How to create lambda with multiple arguments | LabEx
Lambda functions in Python can accept multiple arguments, providing flexibility in creating compact, inline functions.
๐ŸŒ
Afternerd
afternerd.com โ€บ blog โ€บ python-lambdas
Python Lambdas Explained (With Examples) - Afternerd
April 6, 2019 - Yes, at some point in your life you will be wondering if you can have a lambda function with multiple lines. ... Python lambda functions accept only one and only one expression.
๐ŸŒ
Dataquest
dataquest.io โ€บ home โ€บ blog โ€บ how to use a lambda function in python
Lambda Functions in Python (With Examples)
April 21, 2026 - That said, avoid nesting multiple conditions in a lambda. Compare these two approaches: # Lambda with nested conditions (hard to read) (lambda x: x * 10 if x > 10 else (x * 5 if x < 5 else x))(11) # Output: # 110 ยท # Regular function (much clearer) def check_conditions(x): if x > 10: return x * 10 elif x < 5: return x * 5 else: return x print(check_conditions(11)) # Output: # 110
๐ŸŒ
Delft Stack
delftstack.com โ€บ home โ€บ howto โ€บ python โ€บ python lambda multiple args
How to Pass Multiple Arguments in Lambda Functions in Python | Delft Stack
February 12, 2024 - They are inline functions that can be created using the reserved lambda keyword in Python. In this article, readers can anticipate a comprehensive exploration of lambda functions with multiple arguments in Python.
๐ŸŒ
Learn By Example
learnbyexample.org โ€บ python-lambda-function
Python Lambda Function - Learn By Example
April 23, 2020 - Learn to create a Lambda function in Python, pass multiple arguments, return multiple values, combine with map() and filter(), sort iterables, nested lambdas, jump tables and many more.
๐ŸŒ
TestLA Innovations
testla.doa.louisiana.gov โ€บ home โ€บ zulfan
Python Lambda Functions Multiple Arguments - TestLA Innovations
May 29, 2025 - Python lambda functions with multiple arguments offer a concise and flexible way to define small, anonymous functions. They are particularly useful when combined with higher-order functions and list comprehensions.
๐ŸŒ
Delft Stack
delftstack.com โ€บ "delft stack" โ€บ "howto" โ€บ "python how-to's" โ€บ "python lambda with multiple lines"
Python Lambda With Multiple Lines | Delft Stack
February 12, 2024 - ... Using multiline lambda functions in Python is generally discouraged because it reduces code readability and goes against the purpose of lambda functions, which is to provide concise and simple expressions.