input: Write a python function to generate all permutations of a list.
  assert permutation([1, 2, 3]) == [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
  assert permutation([1, 2]) == [[1, 2], [2, 1]]
  assert permutation([1]) == [[1]]
  assert permutation([]) == []
output: def permutation(lst):
      if len(lst) == 0:
          return [[]]
      perms = []
      for i in range(len(lst)):
          rest = lst[:i] + lst[i+1:]
          for p in permutation(rest):
              perms.append([lst[i]] + p)
      return perms