Question: lass Contact: contacts _ list = [ ] def _ _ init _ _ ( self , first _ name, last _ name, email )

lass Contact:
contacts_list =[]
def __init__(self, first_name, last_name, email):
self.first_name = first_name
self.last_name = last_name
self.email = email
def display_contact(self):
return f"{self.first_name},{self.last_name}: {self.email}"
if len(contacts_list)>0:
print(("first_name,last_name:email"))
for contacts in contacts:
print(self.display_contact())
else:
print("No class have been added yet.")
def addcontact(self):
try:
first_name = input("Enter first name: ")
last_name = input("Enter Last name: ")
email = input(input("Enter email: "))
# instantiate contact, add to dictionary
contacts_list.append(self(first_name, last_name, email)) #append Contact
except ValueError:
print('Some data entered is invalid, no data accepted.')
def main():
contacts_list =[]
while True:
print("""
menu options. choose 1,2,3
1.display all contacts
2.create new contact
3.Exit
""")
opt= input("Enter your chioce,1,2,3")
if opt =="1": # display all contact
display_contact(contacts_list)
elif opt =="2": # add a contact
contact = addcontact(contacts_list)
elif opt =="3": # exit program
print("Goodbye")
print()
else:
print("Invalid entry, please re-enter your choice")
print()
main( can you show me what is going wrong

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!