Skip to main content
PProfileMatch
← Path

Python Fundamentals · Python Lists, Dictionaries, Sets and Comprehensions

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Clinic car park: choosing a bay

Trick to keep in mind+3 XP

Braces were claimed by dicts first; a set has to be spelled out as set()

Both dict and set literals use curly braces. {1, 2} is a set and {"a": 1} is a dict, but with nothing inside Python has to pick, and dicts got there first. Always check what a literal produced with type() when in doubt.

print(type({}), type({1}))

Read it once, then a question tests whether the trick stuck.