I'm trying to figure out how to print out the instance of a class with user defined attributes in Python 3. Here is the code I have:
class Attendie:
def __init__(self, fname, lname, company, state, email):
self.fname = fname
self.lname = lname
self.company = company
self.state = state
self.email = email
def getFname(self):
return self.fname
def getLname(self):
return self.lname
def getCompany(self):
return self.company
def getState(self):
return self.state
def getEmail(self):
return self.email
def main():
fname = input("what is the attendie's first name? ")
lname = input("What is the attendie's last name? ")
company = input("What company is the attendie with? ")
state = input("What state is the attendie from? ")
email = input("What is the attendie's email address? ")
Person = Attendie(fname, lname, company, state, email)
print(Person.getFname)
print(Person.getLname)
print(Person.getCompany)
print(Person.getState)
print(Person.getEmail)
if __name__ == '__main__': main()
After I run the program I get these types of error messages.
bound method Attendie.getFname of <main.Attendie object at 0x00000000031DCDD8