class Book: def __init__(self, author, title, book_id): self.author = author self.title = title self.book_id = book_id def __str__(self): return 'Book({}, {}, {})'.format(self.author, self.title, self.book_id) def __repr__(self): return '{} has written the {} # {}'.format(self.author, self.title, self.book_id) def __eq__(self, other): return self.title == other.title and self.author == other.author and self.book_id == other.book_id B1=Book('Masoud Kargar','C++ programming language' , '1') B2=Book('Masoud Kargar','C++ programming language' , '1') print(B1.__str__()) print(B2.__repr__()) if B1==B2: print('The two books have the same specifications')