Python Programming - Functions - Discussion

Discussion Forum : Functions - General Questions (Q.No. 57)
57.
What is the purpose of the functools.reduce function?
To apply a function cumulatively to the items of an iterable.
To reduce the size of a function.
To remove duplicates from an iterable.
To concatenate two iterables.
Answer: Option
Explanation:
The functools.reduce function in Python is used to apply a function cumulatively to the items of an iterable, reducing the iterable to a single cumulative result.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.