Skip to content

Commit 5cb1235

Browse files
[Shubham] Add: provides a remove contact option to user.
1 parent a79e89c commit 5cb1235

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

main.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
@Author: shubham shirke
33
@Date: 2023-06-12 10:30:30
44
@Last Modified by: shubham shirke
5-
@Last Modified time: 2022-06-12 4:30:30
6-
@Title : To update existing contact in address book.
5+
@Last Modified time: 2022-06-12 17:30:30
6+
@Title : To delete contact in address book.
77
'''
88
from AddressBook_Service import *
99

@@ -15,8 +15,9 @@ def main():
1515
print("-----------------------")
1616
print("1.Add contact")
1717
print("2.Update Contact")
18-
print("3.Print Contact")
19-
print("4.Exit")
18+
print("3.Remove contact")
19+
print("4.Print Contact")
20+
print("5.Exit")
2021
print("-----------------------")
2122
choice = int(input("Enter choice: "))
2223
if choice == 1:
@@ -27,6 +28,10 @@ def main():
2728
address_book.update_contact(first_name)
2829

2930
elif choice == 3:
31+
first_name = input("Enter first name to remove: ")
32+
address_book.remove_contact(first_name)
33+
34+
elif choice == 4:
3035
address_book.display_contact()
3136

3237
elif choice == 3:

0 commit comments

Comments
 (0)