Assessment for Lists in Python

May 19, 2014 • Simon Michnowicz

Q1. You want to add the number 3 to the end of list a=[1,2]  What is the correct syntax.

  1. a.append(3)
  2. a.push_back(3)
  3. a.add(3)
  4. append(a,3)

Q2. Write a function that return a list that reverses the order of elements of a list that is an input parameter, i.e if the input is [1,2,3] , the returned list is [3,2,1]