Make sure you removed all debugging print statements error

aaryanreviews at gmail.com aaryanreviews at gmail.com
Mon Aug 8 08:20:52 EDT 2016


Hello guys! I was answering a question on a piece of homework of mine. Sadly I can't answer it correctly due to the repetitive error being "Make sure you removed all debugging print statements." Hopefully one of you guys can help me solve this and also make me understand why I keep on getting this error.

Piece of code:

class Person(object):
    def __init__(self, name):
        self.name = name
        try:
            firstBlank = name.rindex(' ')
            self.lastName = name[firstBlank+1:]
        except:
            self.lastName = name
        self.age = None
    def getLastName(self):
        return self.lastName
    def setAge(self, age):
        self.age = age
    def getAge(self):
        if self.age == None:
            raise ValueError
        return self.age
    def __lt__(self, other):
        if self.lastName == other.lastName:
            return self.name < other.name
        return self.lastName < other.lastName
    def __str__(self):
        return self.name

class USResident(Person):
    def __init__(self, name, status):
        self.name = name
        self.status = status
    
    def getStatus(self):
        return self.status
    
    # def getName(self):
        # return self.name

    
a = USResident('Tim Beaver', 'citizen')
print a.getStatus()
# print(a.getName())

b = USResident('Tim Horton', 'non-resident')
print b.getStatus()




More information about the Python-list mailing list