contacts_list=[] contacts_number=0 def Add_contact(): global contacts_number contact_name=str(input("What is your contact's name ? ")) contact_number=int(input("What is your contact's number ? ")) contact_mail=str(input("What is your contact's mail ? ")) new_contact=Contact(contact_name,contact_number,contact_mail) contacts_list.append(new_contact) contacts_number+=1 class Contact: def __init__(self,name,number,mail): self.name=name self.number=number self.mail=mail self.position=contacts_number while True: choice=None choice=int(input("1 : New contact, 2 Delete Contact, 3 : Display a contact, 4 Display all contacts, 9 Leave ")) if choice==1: Add_contact() elif choice==2: ask=input("How do you want to find your contact (in order to delete him) ? 1 Name, 2 Number, 3 Mail ? ") a=0 if ask=="1": infos=str(input("What is his name ?")) while a