11.9. Debugging

Lists, dictionaries and tuples are known generically as data structures. In this chapter, we have started to see compound data structures, like lists of tuples and dictionaries with tuples as keys and lists as values.

Compound data structures are useful, but they are prone to shape errors; that is, errors caused when a data structure has the wrong type, size, or composition, or perhaps you write some code and forget the shape of your data and introduce an error. For example, if you are expecting a list containing one integer and I just give you an integer that isn’t in a list, it won’t work.

You have attempted of activities on this page