0

Unable to print 'jetta' list that is within this class. I don't know how to print it.

Class Car 
name = jetta

Should I enter return somewhere?

class Car:
    
    model = []
    model2 = []
    model3 = []
    model4 = []
    model5 = []
    
    def __init__(self, name):
        self.name = name # this is the name of the car
        self.brands = []
        self.colors = []
        self.engines = []
        self.countries = [] 
        self.categories = [] #car, minivan, truck, SUV, crossover, eletric
            
    def add_brand(self, brand):
        self.brands.append(brand)
        
    def add_color(self, color):
        self.colors.append(color)
        
    def add_engine(self, engine):
        self.engines.append(engine)
    
    def add_country(self, country):
        self.countries.append(country)
    
    def add_category(self, category):
        self.categories.append(category)
Barmar
  • 741,623
  • 53
  • 500
  • 612
Lucas Batista
  • 143
  • 1
  • 5

0 Answers0