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