Lesson 15 of 55 · Python
Data Structures – Tuples
Duration: 20 minutes
Lesson 15 of 55 · Python
Duration: 20 minutes
python\npoint = (10, 20)\n# Unpack the tuple\nx, y = point\nprint('x =', x, ', y =', y)\n\n# Single‑element tuple needs a trailing comma\nsingle = (42,)\nprint(single)\n\n\nEven though you can’t modify a tuple, you can concatenate or repeat them to produce new tuples.\n