input: Write a function to check if two words are anagrams.
  assert is_anagram("listen", "silent") == True
  assert is_anagram("hello", "billion") == False
  assert is_anagram("rail safety", "fairy tales") == True
  assert is_anagram("dormitory", "dirty room") == True
output: def is_anagram(word1, word2):
      # Remove spaces and lowercase the words
      word1 = word1.replace(" ", "").lower()
      word2 = word2.replace(" ", "").lower()
  
      # Sort the characters in both words and compare
      return sorted(word1) == sorted(word2)