input: Write a function to randomly select one element from a given array.
  
  assert randomElement([1, 2, 3, 4]) in [1, 2, 3, 4]
  assert randomElement([]) == None
  
output: import random
  
  def randomElement(arr):
      if not arr:
          return None
      return random.choice(arr)