append_and_insert.md

June 22, 2022 ยท View on GitHub

Append & Insert

  1. Given the list li = [2, 0, 2, 2]

    1. Append to the end of the list the number 7
    2. Insert to the beginning of the list the number 1
    3. Insert in the second place the number 20
  2. What will be the result of running the following line? li.insert(20, 0)

Solution

Click here to view the solution.