input: 
  def third_largest(lst):
      """This function returns the third largest element in a list provided as input. In case the list doesn't have at least three distinct elements, it returns None.
  
      >>> third_largest([12, 13, 13, 45, 22, 99])
      22
      >>> third_largest([1, 2, 2, 3, 3, 3])
      1
      >>> third_largest([1, 1, 1])
      """
      if len(lst) < 3:
          return
      distinct = []
      for i in lst:
          if i not in distinct:
              distinct.append(i)
      distinct.sort(reverse=True)
      return distinct[2]
  
output:     if len(distinct) < 3:
          return None