from phonebook import * # Make some new phone numbers num1 = PhoneNumber(916, 272, 8010) num2 = PhoneNumber(916, 274, 2805) num3 = PhoneNumber(415, 552, 7909) # Try printing them num1.print_number() num2.print_number() # print num1 # print num2 # Try calling num1.call() # Make a new phone book my_contacts = PhoneBook() # add some contacts my_contacts.add_number("Nick", num1) my_contacts.add_number("Justin", num2) # try calling the contacts my_contacts.call("Nick") my_contacts.call("Justin") # experiment with getting the phone number from the phone book num4 = my_contacts.get_phone_number("Justin") print num1 == num4 print num2 == num4 numbers = my_contacts.get_contacts_in_area_code(916) for num in numbers: num.print_number() # print num