You have been asked to help study the population of birds migrating across the continent. Each type of bird you are interested in will be identified by an integer value. Each time a particular kind of bird is spotted, its id number will be added to your array of sightings. You would like to be able to find out which type of bird is most common given a list of sightings. Your task is to print the type number of that bird and if two or more types of birds are equally common, choose the type with the smallest ID number. For example, assume your bird sightings are of types . There are two each of types and , and one sighting of type . Pick the lower of the two types seen twice: type . Function Description Complete the migratoryBirds function in the editor below. It should return the lowest type number of the most frequently sighted bird. migratoryBirds has the following parameter(s): arr : an array of integers representing types of birds sight...
class Library: def__init__(self,listofbooks,libraryname): self.lst = listofbooks self.name = libraryname def displaybook(self): return f"\t\t\t\tWelcome to {self.name} \ \navaliable books are -\n {self.lst}" def lendbook(self,lendname,bookname): if bookname in lst and bookname not in d: print(f"{bookname} lend to {lendname}") d.__setitem__(bookname,lendname) elif bookname in d: lst.remove(bookname) print("Book is not available lend to-",d[bookname],"\nwe only have-",lst) else: print("Book is not in the library we only have-",lst) ...
Comments
Post a Comment
If you have any doubt you ask me in comment section