input: Write a python function to sort a list of tuples by the second element in each tuple using a lambda function.
  assert sort_by_second([('dog', 6), ('cat', 4), ('rabbit', 2)]) == [('rabbit', 2), ('cat', 4), ('dog', 6)]
  assert sort_by_second([('apple', 10), ('banana', 2), ('cherry', 5)]) == [('banana', 2), ('cherry', 5), ('apple', 10)]
  assert sort_by_second([('x', 3), ('y', 1), ('z', 2)]) == [('y', 1), ('z', 2), ('x', 3)]
output: def sort_by_second(tuples_list):
      return sorted(tuples_list, key=lambda x: x[1])