Python Programming - Classes - Discussion

Discussion Forum : Classes - General Questions (Q.No. 42)
42.
Consider the following Python code:
class Book:
    def __init__(self, title, author):
        self.title = title
        self.author = author

# Create an instance of the Book class
my_book = Book("Python Programming", "John Doe")
# What does the 'my_book' instance represent?
Book class
Python Programming class
John Doe class
An individual book object
Answer: Option
Explanation:
The 'my_book' instance represents a specific book object with the title "Python Programming" and author "John Doe."
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.