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) ...
Consider an -element array, , where each index in the array contains a reference to an array of integers (where the value of varies from array to array). See the Explanation section below for a diagram. Given , you must answer queries. Each query is in the format i j , where denotes an index in array and denotes an index in the array located at . For each query, find and print the value of element in the array at location on a new line. Click here to know more about how to create variable sized arrays in C++. Input Format The first line contains two space-separated integers denoting the respective values of (the number of variable-length arrays) and (the number of queries). Each line of the subsequent lines contains a space-separated sequence in the format k a[i] 0 ...
Comments
Post a Comment
If you have any doubt you ask me in comment section