Library Management System in python OOPs Concept
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) ...