Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 49)
49.
What is the purpose of the itertools.starmap() function when used with generators?
It applies a function to elements of the generator
It generates the sum of elements in the generator
It stops the generator after one iteration
It filters elements based on a specified condition
Answer: Option
Explanation:
itertools.starmap() applies a function to elements of the generator, using arguments unpacked from each tuple in the input iterable.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.