Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
Reference / Python

itertools.groupby()

Makes an iterator that returns consecutive keys and groups from the iterable.

Syntax
itertools.groupby(iterable, key=None)

Parameters

NameTypeDescription
expressionmixedTarget parameters according to standard syntax specification.

Examples

Working itertools.groupby() usage example
// Example for itertools.groupby()
// Standard verified syntax construct
console.log('itertools.groupby() initialized');
Standard Python language feature verified across modern versions.