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.

Before you keep reading...

Runestone Academy can only continue if we get support from individuals like you. As a student you are well aware of the high cost of textbooks. Our mission is to provide great books to you for free, but we ask that you consider a $10 donation, more if you can or less if $10 is a burden.

You have attempted 1 of 4 activities on this page