class Library:
"""
A class to represent a library.
Attributes:
name (str): The name of the library.
books (list): A list of books available in the library.
Methods:
add_book(book): Adds a book to the library's collection.
remove_book(book): Removes a book from the library's collection.
list_books(): Prints a list of all books in the library.
"""
def __init__(self, name):
"""
Initializes the Library class with a name and an empty book list.
Parameters:
name (str): The name of the library.
"""
[Link] = name
[Link] = []
def add_book(self, book):
"""
Adds a book to the library's collection.
Parameters:
book (str): The title of the book to add.
"""
[Link](book)
def remove_book(self, book):
"""
Removes a book from the library's collection.
Parameters:
book (str): The title of the book to remove.
Raises:
ValueError: If the book is not found in the collection.
"""
if book not in [Link]:
raise ValueError(f"'{book}' not found in the library.")
[Link](book)
def list_books(self):
"""Prints a list of all books in the library."""
if not [Link]:
print("The library is empty.")
else:
print(f"Books in {[Link]}: {', '.join([Link])}")