Project 8 will be our way of wrapping up this unit. You are required to finish completing a Contacts Program in Python. This program will manage a list of contacts, each with a name and phone number. Your program should make use of functions to perform each operation.
Open this assignment from the GitHub Classroom first: Project 8 - Contacts
Use a dictionary to store contacts, where the key is the contact's name and the value is their phone number.
add_contact: Adds a new contact to the dictionary.
update_contact: Updates the phone number of an existing contact.
delete_contact: Deletes a contact from the dictionary.
search_contact: Searches for a contact and prints their details.
view_contacts: Lists all contacts in the dictionary.
Your program should handle scenarios like adding a contact that already exists, deleting a contact that doesn't exist, and searching for a contact that isn't in the list.
Procedural programming is a programming paradigm based on the concept of procedure calls.
Procedures, also known as functions or routines, are blocks of code that perform a specific task.
In procedural programming, the focus is on:
Procedure Calls: Functions are called to perform tasks.
Modularity: Code is divided into reusable functions.
Sequential Execution: The program follows a specific sequence of operations.
Shared State Management: Functions often share and modify the same data.
This is the style of programming we have been using in this course so far.
You can see above that the program can be composed of distinct functions, each designed to carry out a specific task.
After opening the contacts program, can you think of how it exemplifies the following?
Procedure Calls
Modularity
Sequential Execution
Shared State Management