-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
34 lines (28 loc) · 1.04 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from ContactModule import *
# Create an instance of ContactManager
contactmanager=ContactManager()
while True:
choice = input("\n\nContact Manager\n1.Add Contact\n2.Remove Contact.\n3.Search Contact \n4.Display Contact\n5.Exit\nEnter your Choice:\n\n")
if choice == "1":
# Add contact
name=input("Enter Name: ")
phone=input("Enter Phone Number: ")
email=input("Enter Email Address: ")
contact=Contact(name,phone,email)
contactmanager.add_contact(contact)
elif choice == "2":
# Remove contact
name=input("Enter Name of Contact That Want to Remove it: ")
contactmanager.remove_contact(name)
elif choice == "3":
# Search contact
name=input("Enter Name of Contact That Want to search it: ")
contactmanager.search(name)
elif choice == "4":
# Display contacts
contactmanager.display_contacts()
elif choice == "5":
# Exit the program
break
else :
print("Error try again")