class Artist:
def __init__(self, name, dob):
self.name = name
self.dob = dob
def get_name(self):
return self.name
def get_dob(self):
return self.dob
def age(self):
if get_date_today() < (2013, 12, 27):
return self.age
else:
return self.age + 1
def get_date_today():
return (2013, 10, 30) #'today'
hw = Artist("Hayley Williams", (1988, 12, 27))
print(hw.age()) # 24 if 'today' is < (2013, 12, 27), 25 if 'today' is >= (2013, 12, 27)
How do I do an addition in the else loop. It can't work here because I can't add 1 to the method. So what is wrong ?