input: Write a function to randomly select one element from a given array. The function should take an array as input and return a randomly selected element from that array. If the given array is empty, it should raise an error or return None.
  assert randomElement([1, 2, 3, 4]) in [1, 2, 3, 4]
  assert randomElement([10, 20, 30]) in [10, 20, 30]
  assert randomElement([]) is None
output: import random
  
  def randomElement(arr):
      if not arr:
          return None
      return random.choice(arr)