Skip to content

Instantly share code, notes, and snippets.

@s2t2
Last active November 23, 2016 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s2t2/ba96899a505ceaba4c32cbe454fb6a99 to your computer and use it in GitHub Desktop.
Save s2t2/ba96899a505ceaba4c32cbe454fb6a99 to your computer and use it in GitHub Desktop.
class Person:
def __init__(self, name, address, phone):
self._name = name
self._address = address
self._phone = phone
#boy = Person("Jake", "123 Main Street", "123-456-7890")
#print(boy._name, boy._address, boy._phone)
class Customer(Person):
def __init__(self, name, address, phone, number, mailing_list):
Person.__init__(self, name, address, phone)
self._number = number
self._mailing_list = (mailing_list == 'True') # convert string to boolean (reference: http://stackoverflow.com/a/715455/670433)
#customer = Customer("Mary", "456 Main Street", "111-222-3333", "456", 'True')
#print(customer._name, customer._address, customer._phone, customer._number, customer._mailing_list)
print("----------------")
print("CUSTOMERS APPLICATION")
print("-----------------")
name = input("Please input the customer's name (e.g. 'Mary'): ")
address = input("Please input the customer's address (e.g. '456 Main Street'): ")
phone_number = input("Please input the customer's phone number (e.g. '111-222-3333'): ")
id_number = input("Please input the customer's ID number (e.g. '789'): ")
mailing_list = input("Please indicate whether or not the customer wants to subscribe to the mailing list (e.g. 'True' or 'False'): ")
customer = Customer(name, address, phone_number, id_number, mailing_list)
print(customer._name, customer._address, customer._phone, customer._number, customer._mailing_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment