Python itertools.groupby Quiz: Runs, Keys and Iterators

Python itertools.groupby Quiz: Runs, Keys and Iterators

Choose one answer. Each attempt draws 10 of 20 questions; the practice pass mark is 8/10. Original topic practice, not an official exam. Consecutive grouping, key functions and shared iterator behaviour in Python 3.
1 of 10
Python 3, with groupby imported: what is [k for k, g in groupby('AABBA')]?