input: Write a python function to rotate elements of a list by a given number of positions.
  assert rotate([1, 2, 3, 4, 5], 2) == [3, 4, 5, 1, 2]
  assert rotate([10, 20, 30, 40, 50, 60], 3) == [40, 50, 60, 10, 20, 30]
  assert rotate([7, 8, 9, 1, 2], 1) == [8, 9, 1, 2, 7]
output: def rotate(lst, positions):
      positions = positions % len(lst)
      return lst[positions:] + lst[:positions]