Python Programming - Classes - Discussion

Discussion Forum : Classes - General Questions (Q.No. 41)
41.
Consider the following Python code:
class Car:
    def __init__(self, make, model, year):
        self.make = make
        self.model = model
        self.year = year

# Create an instance of the Car class
my_car = Car("Toyota", "Camry", 2022)
# What does the 'my_car' instance represent?
Car class
Toyota class
Camry class
An individual car object
Answer: Option
Explanation:
The 'my_car' instance represents a specific car object with the make "Toyota," model "Camry," and year 2022.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.