Loading topic
for loops and functions. It covers the four shapes you will meet most often when data is nested, and how to choose between them. Later chapters cover reading, changing, and copying these shapes.3 min read[0], look up a dictionary key with ["key"], and write a simple for loop. You will learn how to read a value from any depth of a nested structure and how to diagnose the errors this produces.2 min readfor loops and how to read a nested value with chained indexing, such as students[1]["grades"][2]. Here you will use the same chains to change data.2 min readget(), the in operator, and try/except.3 min readfor loop, call items() on a dictionary, and read values with chained indexing such as data["a"][0]. It shows how to visit every value in a nested structure, and which loop style fits each shape.3 min readfor loops and functions, and read nested data with chained indexing. Here you build nested data instead of typing it out by hand.2 min readfor loops and simple functions, and read nested data with chained indexing. It covers why changing one nested value sometimes changes several, and how to avoid it.3 min read[[0] * 3] * 2 repeats one inner list. Copying has the same cause: a copy of a container does not always copy what is inside it.3 min readfor loops and functions. Here you will see how Python's nested data maps to JSON, how to convert between the two, and which values do not survive the trip.3 min readjson.loads() returns nested dictionaries and lists. The chapter shows how to visit every value in a structure when you don't know in advance how3 min read