Beta
Table of Contents
The outline of your notebook will show up here. You can include headings in any text cell by starting a line with #
, ##
, ###
, etc., depending on the desired title hierarchy.
# Contact Management System
contacts = {}
# Create a contact
def create_contact(name, phone, email):
contact = {
'name': name,
'phone': phone,
'email': email
}
contacts[name] = contact
print('Contact created successfully!')
# Read a contact
def read_contact(name):
if name in contacts:
contact = contacts[name]
print('Name:', contact['name'])
print('Phone:', contact['phone'])
print('Email:', contact['email'])
else:
print('Contact not found!')
# Update a contact
def update_contact(name, phone, email):
if name in contacts:
contact = contacts[name]
contact['phone'] = phone
contact['email'] = email
print('Contact successfully!')
else:
print('Contact not found!')
# Delete a contact
def delete_contact(name):
if name in contacts:
del contacts[name]
print('Contact deleted successfully!')
else:
print('Contact not found!')