Compare → Python asks the dictionary itself: record.keys(). JavaScript asks the built-in Object helper: Object.keys(record). Different grammar, identical result, a walkable sequence of the labels.
EXAMPLE
loading editor…
YOUR TURN
Your turn → Make a dictionary describing yourself, with your name, your city and a favorite book, then print its keys and its values.
loading editor…
Syntax has to be exact. Every quote, bracket and parenthesis needs its partner, and in Python the spaces at the start of a line count. One slip and the program won't run; the message will say where.
Mark this lesson complete
Signed in, your progress follows you to every device.