mikuru_chan

Untitled

Feb 24th, 2020
86
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Car:
  2.     def __init__(self, color):
  3.         self.color = color
  4.         self.other = Other()
  5.         self.other.i_like_color_of_this_car(self)
  6.        
  7. class Other:
  8.     def i_like_color_of_this_car(self, car):
  9.         self.chosen_color = car.color
  10.    
  11.     def show_chosen_color(self):
  12.         print(self.chosen_color)
  13.        
  14. red_car = Car("Red")
  15. red_car.other.show_chosen_color(red_car)
RAW Paste Data