Python Collections

1.How do you insert an item at the end of a list?
  • A. list.add()
  • B. list.append()
  • C. list.insert()
  • D. list.push()

list.append()

list.append()

2.How do you define a tuple with one element?
  • A. (1)
  • B. (1,)
  • C. [1]
  • D. {1}

(1,)

(1,)

3.What does list.pop() do?
  • A. Removes the first item
  • B. Removes the last item
  • C. Deletes the list
  • D. Pops all items

Removes the last item

Removes the last item