М
class Car:
color = 'red'
def __str__(self):
return self.color
def copy(self, oldCar):
newCar = Car()
newCar.color = oldCar.color
return newCar
class Driver:
name = 'driver'
car = None
car = Car()
driver = Driver()
driver.car = car.copy(oldCar=Car)
driver.car.color = 'blue'
print(car) # Здесь не должен меняться машины
print(driver.car)
