WAP to define class Book with attributes BookTitle and AuthorName.

WAP to define class Book with attributes BookTitle and AuthorName.

Write a Python program to define class Book with attributes BookTitle and AuthorName. Create two objects of the Book class with different titles and authors. Display the details (title and author) of both objects to show that their attribute values are independent.

class Book:
    def __init__(self, title, author):
        """
        Constructor to initialize BookTitle and AuthorName.
        """
        self.BookTitle = title
        self.AuthorName = author

    def display_details(self):
        """
        Method to display the book's title and author.
        """
        print(f"Book Title: {self.BookTitle}")
        print(f"Author: {self.AuthorName}")
        print("-" * 20)

# --- Creating two book objects (Indian Authors) ---

# Object 1: A book by R.K. Narayan
book1 = Book("The Guide", "R.K. Narayan")
print("Details of Book 1:")
book1.display_details()

# Object 2: A book by Arundhati Roy
book2 = Book("The God of Small Things", "Arundhati Roy")
print("Details of Book 2:")
book2.display_details()

# Demonstrating that they are independent objects
print("--- Changing Book 1's Title ---")
book1.BookTitle = "Malgudi Days"
print("Updated details of Book 1:")
book1.display_details()

print("Details of Book 2 (Unchanged):")
book2.display_details()