"The class should initialize with a name and a birthday, but the birthday should be None." "There should be two methods, name and birthday" "setBirthday sets their Birthday to a date" these are the instructions I was given, this is a small piece in the larger picture.
I'm trying to set the day, the month and year to be entered in by the user...this will be used later for other calculations..
Code:
class person(object):
def __init__(self, name):
self.name = name
self.setBirthday = None
#getName returns the name of the person
def getName(self):
return self.name
#setBirthday sets their Birthday to a date
def setBirthday(self):
day = (raw_input('Please enter the date of the month you were born on here ->'))
return self.day
month = (raw_input('Please enter the month of the year you were born on here ->'))
return self.month
year = (raw_input('Please enter the year you were born on here ->'))
return self.year
varName = person(raw_input('Please enter your name here ->'))
varDate = person.setBirthday()
Can you point me in the right direction? This class stuff really confuses me...I need to have the user be able to input the day, month and year to be saved for later use. error is below in comments. I did remove the returns in my code.