input: Write a function to randomly select one element from a given array. The function should take an array as input and return one randomly selected element from the array. If the array is empty, it should return None.
  
  import random
  
  def randomElement(arr):
      if not arr:
          return None
      return random.choice(arr)
  
  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)