input: Write a function to reverse the order of words in a given string. The function should split the input string into words, reverse the list of words, and then join them back into a single string separated by spaces. If the input string is empty, the function should return an empty string.
  def reverse_words(str):
      return " ".join(str.split()[::-1])
  
  assert reverse_words("Hello world")=="world Hello"
  assert reverse_words("The quick brown fox")=="fox brown quick The"
  assert reverse_words("SingleWord")=="SingleWord"
  assert reverse_words("")==""
output: def reverse_words(str):
      return " ".join(str.split()[::-1])