Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumPythonitertoolsSingle-choice MCQ

What is the result of grouping this already-existing-but-unsorted list with itertools.groupby?

from itertools import groupby data = [1, 1, 2, 1, 1] print([k for k, _ in groupby(data)])