Lecture 19 - Exercises

19A - Mutable Objects and Functions

I recommend drawing the memory diagram as you execute each of the following programs.

  1. What does the following program print?

  2. What does the following program print?

Problems

  1. Implement the following function, without using any built-in list methods:

  2. Implement the following function:

  3. Implement the following function:

  4. Implement the following function, without using any built-in list methods, in such a way that you index into the list less than len(sorted_lst) times.