class Car():
def __init__(self, make, model, year):
self.make = make
self.model = model
self.year = year
my_car = Car('Honda', 'Accord', 2019)
print(f'The make of my car is {my_car.make}')
print(f'The model of my car is {my_car.model}')
print(f'The year of my car is {my_car.year}')
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
class Car():
def __init__(self, make, model, year):
self.make = make
self.model = model
self.year = year
my_car = Car('Honda', 'Accord', 2019)
print(f'The make of my car is {my_car.make}')
print(f'The model of my car is {my_car.model}')
print(f'The year of my car is {my_car.year}')