# wget http://cs.whitman.edu/~davisj/cs/167/2016F/exmpls/lists.py

def swap(data, i, j):
  """Swap the contents of the list data at indices i and j.
  Return value: None; called for its side effects
  """
  #temp = data[i]
  #data[i] = data[j]
  #data[j] = temp
  # A one line version using multiple assignment
  data[i], data[j] = data[j], data[i]

def reverse(data):
  """Reverses the list data in place.
  Return value: None; called for its side effects
  """
  for index in range(len(data)//2):
    swap(data, index, -(index + 1))

squid = [1,2,4,5]
print(squid)
swap(squid,1,3)
print(squid)
reverse(squid)
print(squid)
