At PyCon Lithuania 2026 I did a lightning talk where I presented a βWho wants to be a millionaire?β Python quiz, themed around iterables. There's a whole performance during the lightning talk which was recorded and will be eventually linked to from here. This article includes only the four questions, the options presented, and a basic system that allows you to check whether you got it right or not.
This is an easy one to get you started. It makes more sense if you watch the performance of the lightning talk.
What is the output of the following Python program?
print("Hello, world!")
What is the output of the following Python program?
squares = (x ** 2 for x in range(3))
print(type(squares))
<class 'generator'><class 'gen_expr'><class 'list'><class 'tuple'>This was a reference to the talk I'd given earlier today, where I talked about tee.
The only object in itertools that is not an iterable.
Out of the 20, how many objects in itertools are iterables?
What is the output of the following Python program?
from itertools import *
print(sum(chain.from_iterable(chain(*next(
islice(permutations(islice(batched(pairwise(
count()),5),3,9)),15,None)))))
SyntaxErrorEvery Monday, you'll get a Python deep dive that unpacks a topic with analogies, diagrams, and code examples so you can write clearer, faster, and more idiomatic code.