title: How to NOT print out the memory location python
body: <p>I'm creating this program and one of its functions is to output a list that is initialized in the constructor. But, what's happening is that it is outputting the memory location in hexadecimal or something and I don't know why.</p>
  
  <p>I have two classes and a run class:</p>
  
  <pre class="lang-py prettyprint-override"><code>class Person :
  def __init__(self, name, ID, age, location, destination):
      self.name = name
      self.ID = ID
      self.age = age
      self.location = location
      self.destination = destination
  
  
  def introduce_myself(self):
      print("Hi, my name is " + self.name + " , my ID number is " + str(self.ID) + " I am " + str(self.age) + " years old")
  
  def get_route(self):
      return self.location + self.destination
  
  
  def add2bus(self, Bus):
      if Person.get_route(self) == Bus.get_route() :
          Bus.get_on(Bus)
  
      else :
          print("not compatible")
  
  def get_name(self):
     print(self.name)
  
  import People
  
  class Bus :
  def __init__(self, name, capacity, location, destination):
      self.bus_name = name
      self.bus_capacity = capacity
      self.bus_location = location
      self.bus_destination = destination
      self.seats = []
      self.people = []
  
  
  def Bus_properties(self):
      print(self.bus_name + ", " + str(self.bus_capacity) + ", " + self.bus_location + ", " + self.bus_destination)
  
  def print_list(self):
      a = self.people
      print(self.people)
  
  def get_route(self):
      return self.bus_location + self.bus_destination
  
  def get_on(self, Person):
      if len(self.people) &lt; 20: #Loop through all the seats
          self.people.append(Person)
      else:
          print('fulll')
  
  def get_name(self):
      print(self.name)
  
  
  
  import People
  import Transport
  
  C2C = Transport.Bus("C2C", 30, "Ithaca", "New York")
  Fred = People.Person("Fred", 12323, 13, "Ithaca", "New York")
  Jennifer = People.Person("Jennifer", 111117, 56, "Ithaca", "New York")
  
  Fred.add2bus(C2C)
  Jennifer.add2bus(C2C)
  </code></pre>
  
  <p>I want to create a while loop that takes the length of the peoplelist and with the condition while x &lt; len(C2C.people) then it appends all the names of the people on that bus to a list y</p>
  
  <p>like this...</p>
  
  <pre><code>x = 0
  y = []
  
  while x &lt; len(C2C.people) :
      y.append((C2C.people[x].get_name()))
      x = x + 1
      print(y)
  </code></pre>
  
  <p>but I'm getting this as a result:
  Fred
  [None]
  Jennifer
  [None, None]</p>