Python Phone Book

A phone book like script where you can save name, number and e-mail.

sample image

Here is the link to the source code on github.

Short Description

This python script consists of four main functions.

PhoneBook:
This is the main function that:
– Checks for the existence of “phonebook.txt” and if doesn’t exist then it will be created.
– Checks for the user input “Add, Remove, View, Exit” if the input is correct it goes to the next function, if not it displays an error message. Note: you could run the script bu using “phonebook.py add/remove/view/” and it will jump to the needed function

Remove:
This function removes a contact using either the ID of the contact or the name of the contact and returns an error message if the name or the ID doesn’t exist. Note: if the name exists multiple times it will remove the 1st occurrence.

Add:
This function adds a contact by asking for the name, number and e-mail. Also it gives the new contact a new ID.

View:
This function views one contact or all contacts depending on the users choice. If one contact is selected then the user is asked either to view a contact by name or by ID and returns an error message if the name or the ID doesn’t exist.

If this link helped you do something.

Create your own website, free on WordPress.com.Create your own website.
Start free