input: Write a function to extract the top 10 most frequent words from a given text and return them as a list of tuples where each tuple contains a word and its frequency. If the text is empty, return an empty list.
  assert extract_top_words("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")==[('Lorem', 1), ('ipsum', 1), ('dolor', 1), ('sit', 1), ('amet', 1), ('consectetur', 1), ('adipiscing', 1), ('elit,', 1), ('sed', 1), ('do', 1)]
  assert extract_top_words("Python is great and Python is widely used and Python is fun.")==[('Python', 3), ('is', 3), ('and', 2), ('great', 1), ('widely', 1), ('used', 1), ('fun.', 1)]
  assert extract_top_words("")==[]
output: def extract_top_words(text):
      if not text:
          return []
      words = text.split()
      freq = {}
      for word in words:
          if word in freq:
              freq[word] += 1
          else:
              freq[word] = 1
      sorted_words = sorted(freq.items(), key=lambda x: x[1], reverse=True)
      return sorted_words[:10]