Hi attempting to make an address book program but hit a snag-
I have:
A class to give various attributes(phone numbers etc)to an instance
which then puts it all into a doc string which can be added to a dictionary-
but I want a function that will ask the user for the relevant information and then feed it to the class as the relevant arguments. however I Can't figure that out. Any Ideas-Section of code below:
class Data:
def __init__(self, home, mobile, email):
self.home = home
self.mobile = mobile
self.email = email
def Coll_Data(self):
self.info = """
Home Phone: %s
Mobile Phone: %s
Email: %s
""" % (self.home, self.mobile, self.email)
#the bit that doesn't work that needs changing is below:
def add_new():
name = raw_input("Enter name to be added: ")
h = raw_input("Enter home phone: ")
m = raw_input("Enter Mobile phone: ")
e = raw_input("Enter Email address: ")
name = Data(h, m, e)
Please help!!!!!!