# Example of a class # A201 Fall 2020 class Car: gears = {1: 5, 2: 15, 3: 35, 4: 50, 5: 90} def __init__(self, make="Ford", model="Fiesta", year=2016, color="yellow"): self.make = make self.model = model self.year = year self.color = color self.__wheels = 4 def findGear(speed): for gear in Car.gears: if speed <= Car.gears[gear]: return gear return -1 def show(self): print("The car is a", self.color, self.make, self.model, "from", self.year) # Checks if the object is older than the other object. def olderThan(self, other): if self.year < other.year: return True else: return False def makeRed(car): car.color = "red" def main(): c = Car() d = Car("VW", "Golf", 2012, "green") makeRed(d) c.show() d.show() print(c.year) main()