13. Basic Contact Book Beginner Projects
1. Basic Features
-
Add Contacts: Allow the user to add new contacts with details like name, phone number, and
email.
- View Contacts: Display a list of all stored contacts.
- Search Contacts: Let the user search for a contact by name.
- Delete Contacts: Allow the user to delete a contact from the contact book.
2. Workflow
-
Adding Contacts:
- Prompt the user to input contact details such as name, phone number, and email.
- Store these details in a structured way (e.g., using a dictionary or list).
-
Viewing Contacts:
- Provide an option for the user to view all saved contacts.
- Display the contact information in a clean, readable format.
-
Searching Contacts:
- Allow the user to input a contact name to search for.
- Display the details of the matching contact, if found.
-
Deleting Contacts:
- Let the user delete a contact by specifying the name.
- Confirm before permanently removing the contact.
3. Error Handling
-
Input Validation:
- Ensure valid input for contact details, such as checking for valid phone numbers and email formats.
- Prevent duplicate contacts by checking if the contact already exists.
-
Feedback:
- Inform the user if a contact they are searching for or trying to delete is not found.
- Provide clear error messages for invalid inputs (e.g., empty names or incorrect phone numbers).
4. Optional Features
-
Edit Contacts:
- Provide functionality for the user to update or edit a contact’s details.
-
Save to File:
-
Allow users to save their contact book to a file and load it back when the program starts, so the contact
book persists between sessions.
-
Sort Contacts:
- Implement sorting (by name, phone number, etc.) to display contacts in a sorted manner.
-
Interactive Menu:
-
Create a simple interactive menu to navigate between adding, viewing, searching, deleting, and exiting the
program.
5. Learning Outcomes
This project will give you practice with:
- Data structures (storing contacts in dictionaries or lists)
- Functions for handling different operations (add, view, delete, search)
- File handling (optional) to save and load contacts
- Error handling and validation of user input