class Car: wheels = 4 def __init__(self, make, model): self.make = make self.model = model
print(Car.wheels) # Output: 4 car1 = Car("Toyota", "Camry") print(car1.wheels) # Output: 4 car2 = Car("Honda", "Accord") print(car2.wheels) # Output: 4
4 4 4
class Car: wheels = 4 def __init__(self, make, model): self.make = make self.model = model
car1 = Car("Toyota", "Camry") print(car1.make) # Output: Toyota print(car1.model) # Output: Camry car2 = Car("Honda", "Accord") print(car2.make) # Output: Honda print(car2.model) # Output: Accord
Toyota Camry Honda Accord