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?
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:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers