Why print the objects location istead of the value - Solved

When working on the “School Catalogue” project I encounter this problem is that:

from abc import ABC, abstractmethod

class School(ABC):
  name = None
  level = None
  numberOfStudents = None

  def __init__(self, name, level, numberOfStudents):
    self.name = name
    self.level = level
    self.numberOfStudents = numberOfStudents
  def get_name(self):
    return self.name
  def get_level(self):
    return self.level
  def get_numberOfStudents(self):
    return self.numberOfStudents
  def setting_all(self, **args):
    for i in items(args):
      if(i[0] == "name"):
        self.name = i[1]
      elif(i[0] == "level"):
        self.level = i[1]
      elif(i[0] == "numberOfStudents"):
        self.numberOfStudents = i[1]
    **def __repr__(self):**
**      return "name is: {} \n Level is: {} \n Number of student is: {}".format(str(self.name), str(self.level),** str(self.numberOfStudents))

class Primary(School):
  def __init__(self, name, level, numberOfStudents, _pickupPolicy):
    super().__init__(name, level, numberOfStudents)
    self._pickupPolicy = _pickupPolicy
  def get_pickupPolicy(self):
    return self._pickupPolicy
  def setting_all(self, **args):
    self._pickupPolicy = args.get("pickupPolicy")
  **def __repr__(self):**

**    val = super().__repr__() **
**    # return " name is: {}\n Level is: {}\n Number of student is: {}".format(str(self.name), str(self.level), str(self.numberOfStudents)) +  "\n Pickup Policy is: {}".format(str(self._pickupPolicy))**
**    return val + "\n Pickup Policy is: {}".format(str(self._pickupPolicy))**

k = Primary("Joe", 2, 4, "No refund")

THe result is following:

<main.Primary object at 0x7fb21e7bc438>
Pickup Policy is: No refund

So why above code print out the address of the class instead of the string that is in the class?

Thanks for helping me

The focus is on this part:

def __repr__(self):
      return "name is: {} \n Level is: {} \n Number of student is: {}".format(str(self.name), str(self.level), str(self.numberOfStudents))

def __repr__(self):
    val = super().__repr__() 
    return val + "\n Pickup Policy is: {}".format(str(self._pickupPolicy))

Hello, the problem is solved!

I realized this is an indentation problem. That is there should be an indentation for the repr in the School Class. Because there is double indentation, the python recongnize the method as an inner method of setting_all. Therefore, there is no repr function for School class, as so the problem happened.