Python Programming - Lambda Functions - Discussion

Discussion Forum : Lambda Functions - General Questions (Q.No. 35)
35.
What does the following lambda function accomplish?
lambda x: x.split()[0]
Splits a string into a list.
Extracts the first word from a string.
Concatenates two strings.
Reverses a string.
Answer: Option
Explanation:
The lambda function extracts the first word from a string using the split() method.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.