The Full address3.py Code
Now it seems that we have everything we need to run our program, but first let's see all of address3.py, including the scaffolding code.
class Address: """This class represents an entry in an address book""" #Constructor def __init__(self, name="", phone_number="", address_lines=[]): """ The constructor takes three arguments: name to hold the persons name (string) phone_number to hold the persons phone number (string) address_lines to hold the address of the person (list) """ # assign the name, phone_number and address_lines to the # instance variables # __name, __phone_number, and __lines self.__name=name self.__phone_number=phone_number self.__lines=address_lines #Methods def save(self, file): """ The save method ...
Get Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.