Could y'all help me solve this in python. The questions are in the comments class Dog: def __init__(self, name, bre
Posted: Fri Jul 01, 2022 5:35 am
Could y'all help me solve this in python. The questions are in the commentsclass Dog: def __init__(self, name, breed, age, weight, favorite_toy): self.__name = name self.__breed = breed self.__age = age self.__weight = weight self.__favorite_toy = favorite_toy def getName(self): return self.__name def getBreed(self): return self.__breed def getAge(self): return self.__age def getWeight(self): return self.__weight def getFavoriteToy(self): return self.__favorite_toy def setName(self, newName): self.__name = newNamedef list_and_object_stuff(dog_list): # YOUR CODE HERE # dog_list is a list of Dog objects and the Dog class is above # complete the following steps # 1. using a single for loop, print the names of all dogs in the list # 2.using a single while loop, print the breeds of all dogs except # the first one and the last one in the list # 3. print the sum of years (age) of dogs in the list, # which weigh more than 50 lbs # 4. print the favorite toy of every other dog in the list (the first, 3rd, 5th etc) # 5. change the name of every dog in the list to "Bug" # END OF YOUR CODEif __name__=="__main__": # leave this alone dog_list = [Dog("Jackson", "GSP", 7, 87.7, "frisbee"), Dog("Minnie", "toy poodle", 2, 24.3, "stuffed sloth"), Dog("Apple", "boxer", 3, 30.1, "tennis ball"), Dog("Mojo", "doberman", 4, 66.2, "sticks"), Dog("Pancake", "pitbull", 6, 44.3, "rubber bone"), Dog("Lollipop", "labradoodle", 2, 88.3, "ice cubes"), Dog("Winnie", "westie", 11, 9.4, "stuffed bear"), Dog("Charlie", "chocolate lab", 2, 76.7, "your face"), Dog("Taco", "terrier", 4, 7.1, "balloons"), Dog("Lucky", "italian greyhound", 9, 22.1, "pillow to nap on")] list_and_object_stuff(dog_list)