input: Write a function to remove elements by value from a list.
  assert remove_by_val([1, 2, 3, 4, 2], 2) == [1, 3, 4]
  assert remove_by_val([5, 6, 7, 8, 9], 5) == [6, 7, 8, 9]
  assert remove_by_val([10, 20, 30, 20, 40], 20) == [10, 30, 40]
output: def remove_by_val(lst, val):
      return [x for x in lst if x != val]