i need to do make a code that does the following:
β’ Define a Book class with attributes for title, author, and ISBN.
β’ Define a User class with attributes for the user's name and a list of borrowed books.
β’ Implement methods in the User class for borrowing and returning books.
β’ Demonstrate the system's functionality with examples of several Book and User objects in
action.
this is what i have so far:
class Book:
def __init__(self, title, author, ISBN):
self.title = title
self.author = author
self.ISBN = ISBN
class User:
booksborrowed = []
def __init__(self, username, borrowed_books=0):
self.__username = username
self.borrowed_books = borrowed_books
def borrowBook(self, book):
self.booksborrowed.append(book)
@classmethod
def bookCount(cls):
return f' {cls} has these books out: {booksborrowed}.'
im trying to add a class variable under the user class to be able to output the list of the borrowed books but its not working