Quiz on Python itertools.combinations() Function



1. What is the primary purpose of the itertools.combinations function in Python?
2. What type of output does itertools.combinations return?
3. How do you specify the length of combinations in itertools.combinations?
4. What will be the output of itertools.combinations('ABC', 2)?
5. What happens if you set the length of combinations greater than the length of the iterable?

Advertisements