-
This program simulates a phone book application. Given n​ names and phone numbers, it assembles a phone book that maps friends' names to their respective phone numbers.
-
Clone this repository into your local machine. Ensure you have python3 installed as it is required by this application. Once you have cloned this repository locally. Move into the cloned directory e.g.
phone_book
and runpython3 phone_book_example.py
. -
- Ensure you are in the directory that you cloned the repository into i.e.
phone_book
if you did not specify any. - Type
python3 phone_book_example.py
at the terminal. The program will run and wait for input from you. - Enter the input given below
3 sam 99912222 tom 11122227 harry 12299933 Sam Edward harry
- Press
Ctrl+D
on the terminal to submit the input to the application. - You will get the following response
sam=99912222 Not found harry=12299933
- The response for Edward is not found because he was not added to the phone book initially. Also, note that your inputs have to meet the following requirements
- The entries have to be equal to the number you input first i.e. if 3, then you must have 3 entries(name + space + number). You can have as many queries as you want i.e. only the names as shown above.
- You must use spaces to separate the names from the numbers
- Ensure you are in the directory that you cloned the repository into i.e.
-
To run tests, type the codes below to test each of the two classes
python3 test_phone_entry.py
forPhoneEntry
python3 test_phone_book.py
forPhoneBook
-
While running the application, you may encounter errors anticipated by the application e.g. invalid input. You will find these in a file called
app.log
in the same directory as the main program.