Question 1 of 30
In a data processing application, you are tasked with applying a transformation to a list of integers to compute their squares. You decide to use a lambda function for this purpose. Given the list `numbers = [1, 2, 3, 4, 5]`, which of the following code snippets correctly utilizes a lambda function to achieve this transformation and returns a new list containing the squares of the original integers?
`squared_numbers = list(map(lambda x: x**2, numbers))`
`squared_numbers = [lambda x: x**2 for x in numbers]`
`squared_numbers = filter(lambda x: x**2, numbers)`
`squared_numbers = [x**2 for x in numbers]`

Preparing for Microsoft 98-381 Introduction to Programming Using Python? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free