Skip to content
dreamcode
dreamcode
Back to map
Sets & tuples · Lesson 25 of 44
+15 XP on finish
PYTHON INTERMEDIATE

Sets and tuples

A tuple is an immutable list written with parentheses `()`. A set is an unordered collection of unique elements written with curly braces `{}`.

How it reads
point = (10, 20) defines an immutable tuple
{"wispy", "puffy", "wispy"} creates a set, filtering out duplicates
Cloud tip: Use sets when checking membership or removing duplicates, and tuples for structured coordinates or records.
main.py
PYTHON
real Python, runs in your browser
CONSOLE
- run your code to see output -