Courses/Collections & Stdlib Toolbox

๐Ÿงฐ Collections & Stdlib Toolbox

namedtuple

Lightweight immutable records with attribute access.

namedtuple builds a tiny class with named fields โ€” same speed as a tuple, but you can write p.x instead of p[0].

main.py
Output
Press Run to execute.
Expected output
3 4
{'x': 3, 'y': 4}

Sign in to track your progress across lessons.