Help needed with Animal Shelter coding assignment - failing multiple tests

From the given code, it seems that you are missing the implementations for the doesAnimalExist, GetSpecies, and removeSpecies methods in your AnimalShelter class. I’ll provide you with the missing implementations for these methods.

  1. doesAnimalExist method:

pythonCopy code

def doesAnimalExist(self, animal):
    if animal is None or animal.species is None:
        return False
    species = animal.species.upper()
    if species in self.AnimalDictionary:
        return animal in self.AnimalDictionary[species]
    return False
  1. GetSpecies method:

pythonCopy code

def GetSpecies(self, species):
    if species is None:
        return None
    species = species.upper()
    if species in self.AnimalDictionary:
        return '\n'.join([animal.toString() for animal in self.AnimalDictionary[species]])
    return None
  1. removeSpecies method:

pythonCopy code

def removeSpecies(self, species):
    if species is None:
        return False
    species = species.upper()
    if species in self.AnimalDictionary:
        del self.AnimalDictionary[species]
        return True
    return False

Add these methods to your AnimalShelter class and then rerun your tests.