# a program for keeping track of used cars problem designed by mflax@leadps.org represents a single car
class Car(object):
	# every car has a make, model, year, and color
	def __init__(self, make, model, year, color):
		self.make = make
		self.model = model
		self.year = year
		self.color = color
	# prints the ad for this car to the terminal
	def ad(self):
		print("Buy this beautiful " + self.color + " " + str(self.year) + " " + self.make + " " + 
self.model + "!")
# takes a list of Car objects and prints the ad for all of them
def printAds(carList):
	for c in carList:
		c.ad()
# THE loadCars FUNCTION IS FOR YOU AND YOUR PARTNER TO IMPLEMENT takes a list to fill with Car objects and a 
# filename for saved Cars opens the file, creates new Car objects and adds them to the list note that you can 
# pass a list and that the things you add to it will be there after calling this function this isn't true in 
# every language!!
def loadCars(carList, filename):
	# open the file read each line from the file for each one, pull apart the variables to create a Car 
	# object close the file placeholder
	x = open(filename, 'r')
	y = x.readline()
	while y != "":
		z = y.split()
		carList.append(Car(z[0], z[1], z[2], z[3]))
		y = x.readline()
	x.close()
# execution starts here! here's an empty list that we'll fill with cars
ourCars = []
# we'll add this car to start as an example of adding a car to our list
ourCars.append(Car("Honda", "Fit", 2009, "Grey"))
# here you load the list of cars
print("Hey user, what's the file name of your car list?")
name = raw_input() 
loadCars(ourCars, name)
# now we'll walk through the list
printAds(ourCars)

ba66844dc0a05f161f1c82e315d455f7286f5ccb
class Car(object):

    def __init__(self, make, model, year, color):
        self.make = make
        self.model = model
        self.year = year
        self.color = color

    def ad(self):
        print('Buy this beautiful ' + self.color + ' ' + str(self.year) +
            ' ' + self.make + ' ' + self.model + '!')


<mask token>

class Car(object):

    def __init__(self, make, model, year, color):
        self.make = make
        self.model = model
        self.year = year
        self.color = color

    def ad(self):
        print('Buy this beautiful ' + self.color + ' ' + str(self.year) +
            ' ' + self.make + ' ' + self.model + '!')


<mask token>


def loadCars(carList, filename):
    x = open(filename, 'r')
    y = x.readline()
    while y != '':
        z = y.split()
        carList.append(Car(z[0], z[1], z[2], z[3]))
        y = x.readline()
    x.close()


<mask token>

class Car(object):

    def __init__(self, make, model, year, color):
        self.make = make
        self.model = model
        self.year = year
        self.color = color

    def ad(self):
        print('Buy this beautiful ' + self.color + ' ' + str(self.year) +
            ' ' + self.make + ' ' + self.model + '!')


def printAds(carList):
    for c in carList:
        c.ad()


def loadCars(carList, filename):
    x = open(filename, 'r')
    y = x.readline()
    while y != '':
        z = y.split()
        carList.append(Car(z[0], z[1], z[2], z[3]))
        y = x.readline()
    x.close()


<mask token>
ourCars.append(Car('Honda', 'Fit', 2009, 'Grey'))
print("Hey user, what's the file name of your car list?")
<mask token>
loadCars(ourCars, name)
printAds(ourCars)

class Car(object):

    def __init__(self, make, model, year, color):
        self.make = make
        self.model = model
        self.year = year
        self.color = color

    def ad(self):
        print('Buy this beautiful ' + self.color + ' ' + str(self.year) +
            ' ' + self.make + ' ' + self.model + '!')


def printAds(carList):
    for c in carList:
        c.ad()


def loadCars(carList, filename):
    x = open(filename, 'r')
    y = x.readline()
    while y != '':
        z = y.split()
        carList.append(Car(z[0], z[1], z[2], z[3]))
        y = x.readline()
    x.close()


ourCars = []
ourCars.append(Car('Honda', 'Fit', 2009, 'Grey'))
print("Hey user, what's the file name of your car list?")
name = raw_input()
loadCars(ourCars, name)
printAds(ourCars)

# a program for keeping track of used cars problem designed by mflax@leadps.org represents a single car
class Car(object):
	# every car has a make, model, year, and color
	def __init__(self, make, model, year, color):
		self.make = make
		self.model = model
		self.year = year
		self.color = color
	# prints the ad for this car to the terminal
	def ad(self):
		print("Buy this beautiful " + self.color + " " + str(self.year) + " " + self.make + " " + 
self.model + "!")
# takes a list of Car objects and prints the ad for all of them
def printAds(carList):
	for c in carList:
		c.ad()
# THE loadCars FUNCTION IS FOR YOU AND YOUR PARTNER TO IMPLEMENT takes a list to fill with Car objects and a 
# filename for saved Cars opens the file, creates new Car objects and adds them to the list note that you can 
# pass a list and that the things you add to it will be there after calling this function this isn't true in 
# every language!!
def loadCars(carList, filename):
	# open the file read each line from the file for each one, pull apart the variables to create a Car 
	# object close the file placeholder
	x = open(filename, 'r')
	y = x.readline()
	while y != "":
		z = y.split()
		carList.append(Car(z[0], z[1], z[2], z[3]))
		y = x.readline()
	x.close()
# execution starts here! here's an empty list that we'll fill with cars
ourCars = []
# we'll add this car to start as an example of adding a car to our list
ourCars.append(Car("Honda", "Fit", 2009, "Grey"))
# here you load the list of cars
print("Hey user, what's the file name of your car list?")
name = raw_input() 
loadCars(ourCars, name)
# now we'll walk through the list
printAds(ourCars)
