Python Programming - Classes - Discussion

Discussion Forum : Classes - General Questions (Q.No. 45)
45.
Consider the following Python code:
class Laptop:
    def __init__(self, brand, model):
        self.brand = brand
        self.model = model

# Create an instance of the Laptop class
my_laptop = Laptop("Dell", "XPS 13")
# What does the 'my_laptop.brand' represent?
Laptop class
Dell class
XPS 13 class
An individual laptop object
Answer: Option
Explanation:
'my_laptop.brand' represents the specific brand attribute of the individual laptop object.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.