Reinforce that certain types in Python such as lists are mutable while others (e.g. strings, tuples) are not. Students have difficulty tracing code that uses mutable types because they often forget this.

  • It is important for students to realize that mutable types may have immutable methods. For example, the index() and count() methods are immutable list methods.

The opinions expressed are those of the Suzanne Matthews and not necessarily the position of the Army or DoD.

More about this tip

External Source

Interview with Suzanne Matthews