title: Python 2.6: Class inside a Class?
body: <p>Hey everyone, my problem is that im trying to figure out how to get a class INSIDE another class.</p>
  
  <p>What I am doing is I have a class for an Airplane with all its statistics as to how fast it can fly, how far it can go, fuel consumption, and so on. Then I have a Flight Class which is all the details about the flight: Distance, starting location and time, ending location and time, duration, and so on.</p>
  
  <p>But I realized that each airplane has multiple flights, so why not put all the flight data into the airplane class? Although how do i put a class INTO another class so i can call something like this:</p>
  
  <pre><code>Player1.Airplane5.Flight6.duration = 5 hours
  </code></pre>
  
  <p>Ive somewhat done it with the airplane class, but when i go to save the information (listing everything out into a text document), all it gives me is the Hex location of the data and not the actual strings.</p>
  
  <pre><code>class Player (object):#Player Class to define variables
      '''Player class to define variables'''
  
      def __init__ (self, stock = 0, bank = 200000, fuel = 0, total_flights = 0, total_pax = 0):
          self.stock = stock
          self.bank = bank
          self.fuel = fuel
          self.total_flights = total_flights
          self.total_pax = total_pax
          self.Airplanes = Airplanes
          self.flight_list = flight_list
  </code></pre>
  
  <p>Is there a way to put a class inside a class? or will i need to make one super Player class which handles all the information which im using other classes for?</p>