SHARE
TWEET

train_wagon

DeaD_EyE Jul 13th, 2018 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Wagon:
  2.     pass
  3.  
  4. class Train:
  5.     def __init__(self, wagons=None):
  6.         if wagons:
  7.             self.wagons = wagons
  8.         else:
  9.             self.wagons = []
  10.     def add_wagon(self, wagon):
  11.         self.wagons.append(wagon)
  12.  
  13. w1 = Wagon()
  14. train = Train()
  15. train.add_wagon(w1)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top