input: Write a function to print a random element from a given list. The function should return the random element. If the given list is empty, it should return None.
  
  assert random_element(["apple", "banana", "mango", "pear", "grape"]) in ["apple", "banana", "mango", "pear", "grape"]
  assert random_element([])==None
output: import random
  
  def random_element(lst):
      if not lst:
          return None
      return random.choice(lst)