Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Car:
- def __init__(self, color):
- self.color = color
- self.other = Other()
- self.other.i_like_color_of_this_car(self)
- class Other:
- def i_like_color_of_this_car(self, car):
- self.chosen_color = car.color
- def show_chosen_color(self):
- print(self.chosen_color)
- red_car = Car("Red")
- red_car.other.show_chosen_color(red_car)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement