input: Write a python function to categorize a list of animals into mammals, birds, reptiles, and fish.
  assert categorize_animals(["dog", "cat", "fish", "frog", "bird"]) == {"mammals": ["dog", "cat"], "birds": ["bird"], "reptiles": ["frog"], "fish": ["fish"]}
  assert categorize_animals(["elephant", "sparrow", "lizard", "goldfish", "cat"]) == {"mammals": ["cat"], "birds": ["sparrow"], "reptiles": ["elephant", "lizard"], "fish": ["goldfish"]}
  assert categorize_animals(["dog", "iguana", "parrot", "shark"]) == {"mammals": ["dog"], "birds": ["parrot"], "reptiles": ["iguana"], "fish": ["shark"]}
output: def categorize_animals(animals):
      categories = {"mammals": [], "birds": [], "reptiles": [], "fish": []}
      mammal_list = ["dog", "cat", "elephant"]
      bird_list = ["bird", "sparrow", "parrot"]
      reptile_list = ["frog", "lizard", "iguana"]
      fish_list = ["fish", "goldfish", "shark"]
      
      for animal in animals:
          if animal in mammal_list:
              categories["mammals"].append(animal)
          elif animal in bird_list:
              categories["birds"].append(animal)
          elif animal in reptile_list:
              categories["reptiles"].append(animal)
          elif animal in fish_list:
              categories["fish"].append(animal)
      
      return categories