The Palos Publishing Company

Follow Us On The X Platform @PalosPublishing
Categories We Write About

Build a contact information organizer

Here is a simple and functional Contact Information Organizer that can store and manage names, phone numbers, emails, and addresses. This version is built in Python and can be extended or adapted to other environments like a web app or Excel macro depending on your needs.

python
class Contact: def __init__(self, name, phone, email, address): self.name = name self.phone = phone self.email = email self.address = address def __str__(self): return f"Name: {self.name}nPhone: {self.phone}nEmail: {self.email}nAddress: {self.address}" class ContactBook: def __init__(self): self.contacts = [] def add_contact(self, contact): self.contacts.append(contact) print(f"Contact for {contact.name} added.") def list_contacts(self): if not self.contacts: print("No contacts found.") return for i, contact in enumerate(self.contacts, 1): print(f"nContact {i}:n{contact}") def search_contact(self, name): results = [c for c in self.contacts if name.lower() in c.name.lower()] if results: for contact in results: print(f"nFound:n{contact}") else: print(f"No contacts found for name: {name}") def delete_contact(self, name): for contact in self.contacts: if contact.name.lower() == name.lower(): self.contacts.remove(contact) print(f"Contact for {name} deleted.") return print(f"No contact found with name: {name}") def main(): book = ContactBook() while True: print("n--- Contact Organizer Menu ---") print("1. Add Contact") print("2. List Contacts") print("3. Search Contact") print("4. Delete Contact") print("5. Exit") choice = input("Enter your choice: ") if choice == '1': name = input("Name: ") phone = input("Phone: ") email = input("Email: ") address = input("Address: ") contact = Contact(name, phone, email, address) book.add_contact(contact) elif choice == '2': book.list_contacts() elif choice == '3': search_name = input("Enter name to search: ") book.search_contact(search_name) elif choice == '4': delete_name = input("Enter name to delete: ") book.delete_contact(delete_name) elif choice == '5': print("Exiting Contact Organizer.") break else: print("Invalid choice. Try again.") if __name__ == "__main__": main()

Features:

  • Add, list, search, and delete contacts

  • Clean command-line interface

  • Object-oriented structure for easy expansion

Would you like a version for web, mobile, or Excel too?

Share this Page your favorite way: Click any app below to share.

Enter your email below to join The Palos Publishing Company Email List

We respect your email privacy

Categories We Write About