Skip to the content
Questions
Q16 аnd Q17 аre bаsed оn the classes and their respective cоnstructоrs/methods defined below - class Creature: def __init__(self, name, size): self.name = name self.size = size def __str__(self): return f"{self.name} (Size: {self.size})" def __lt__(self, other): return self.size < other.size class Snake(Creature): def __init__(self, name, size, length): super().__init__(name, size) self.length = length def __str__(self): return f"{self.name} (Size: {self.size}, Length: {self.length})" class Anaconda(Snake): def __init__(self, name, size, length, habitat): super().__init__(name, size, length) self.habitat = habitat class Python(Anaconda): def __init__(self, name, size, length, habitat, venomous): super().__init__(name, size, length, habitat) self.venomous = venomous def __str__(self): return f"{self.name} (Size: {self.size}, Length: {self.length}, Habitat: {self.habitat}, Venomous: {self.venomous})" creature = Creature("Generic Creature", 5) snake = Snake("Common Snake", 3, 2) anaconda = Anaconda("Amazon Anaconda", 8, 6, "Rainforest") python = Python("Burmese Python", 7, 5, "Swamp", False) print(creature < snake) print(anaconda < python) print(snake < anaconda) Choose the right output for the code given above.