def make_animal(kind): if kind == 'cat': return cat.Cat() if kind == 'dog': return dog.Dog() if kind == 'sheep': return sheep.Sheep() return animal.Animal(kind)
def make_animal(kind): """Create an animal class.""" if kind == 'cat': return cat.Cat() if kind == 'dog': return dog.Dog() if kind == 'sheep': return sheep.Sheep() return animal.Animal(kind)
def make_animal(kind): """make animal""" if kind == 'cat': return cat.Cat() if kind == 'dog': return dog.Dog() if kind == 'sheep': return sheep.Sheep() if kind == 'leopard': return leopard.Leopard() return animal.Animal(kind)
def create_animal(kind): """Create an animal class.""" if kind == 'cat': return cat.Cat() if kind == 'dog': return dog.Dog() if kind == 'lion': return lion.Lion() if kind == 'leopard': return leopard.Leopard() if kind == 'sheep': return sheep.Sheep() return animal.Animal(kind)
import farm def make_animal(kind): """Create an animal class.""" if kind == 'cat': return cat.Cat() if kind == 'dog': return dog.Dog() <<<<<<< HEAD if kind == 'lion': return lion.Lion() ======= if kind == 'leopard': return leopard.Leopard() >>>>>>> feature-leopard if kind == 'sheep': return sheep.Sheep() return animal.Animal(kind) def main(animals): animal_farm = farm.Farm() for animal_kind in animals: animal_farm.add_animal(make_animal(animal_kind)) animal_farm.print_contents() if __name__ == '__main__': if len(sys.argv) == 1: print('Pass at least one animal type!') sys.exit(1) main(sys.argv[1:])