Question

Write a code using python to make an Agenda that can store values such as Name,...

Write a code using python to make an Agenda that can store values such as Name, Address and Phone number of 10 digits

Name format First, Last

Address Format Street, Number Zip City ST. Country

phone format (###) ###-####

This program should give the option of adding a new contact or Display all the contacts you have stored by typing New Contact or Display Contacts

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

def new_contact(): #difining the new function to add the contact
name = input("Enter Name of Contact: ") #taking necessary inputs....
address = input("Enter the Address of Contact: ")
phone = input("Enter the Phone Number: ")
mycontact = {'Name':name, 'Address':address, 'Phone Number':phone} #store all the inputs into a dictationary datatype
print("Contact sucessfully added")
return mycontact #it will return the dictationary of contact.

contacts_list=[] #this will store all the contacts
while True: #infinite loop
action=input("Type New Contact or Display Contacts or 'Exit' to exit the program ")
if action=='New Contact': #conditions
contacts_list.append(new_contact()) #here I call the function which return the dict of contact
if action=='Display Contacts': #condition to display the contact....
print(contacts_list)
if action=='Exit': # condition to break the loop
break

ScreenShot:

Output of program is given below the cell.

You can also use nested dict to store the contacts.

If you have further doubts let me know in comments.

Please Like my Efforts.

Thank You.

Add a comment
Know the answer?
Add Answer to:
Write a code using python to make an Agenda that can store values such as Name,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • a. Define the struct node that can store a name and up to 3 phone numbers...

    a. Define the struct node that can store a name and up to 3 phone numbers (use an array for the phone numbers). The node struct will also store the address to the next node. b. Define a class contactList that will define a variable to keep track of the number of contacts in the list, a pointer to the first and last node of the list. c. Add the following methods to the class: i. Add a new contact....

  • Your task for this project is to write a parser for a customer form. You need to develop a Java a...

       Your task for this project is to write a parser for a customer form. You need to develop a Java application using Parboiled library. Your program should include a grammar for the parser and display the parse tree with no errors. Remember that your fifth and sixth assignments are very similar to this project and you can benefit from them. The customer form should include the following structure: First name, middle name (optional), last name Street address, city, state (or...

  • C++: Array of contact info Design a contact struct, that takes your phone struct and address...

    C++: Array of contact info Design a contact struct, that takes your phone struct and address struct along with a c string for a name to create a record of contact information. ( C++: Design a Struct Design two structs address and phone Address has the following attributes: street address, city name, state code, zip code. phone has 3 numbers: area code, prefix and suffix test these by writing a program that creates one of each and fills them with...

  • Write a java project that reads a sequence of up to 25 pairs of names and...

    Write a java project that reads a sequence of up to 25 pairs of names and postal (ZIP) codes, street address, city, state, and 10-digit phone number for individuals. Store the data in an object designed to store a first name (string), last name (string), and postal code (integer), street address (string), city( string), state (string), and 10-digit phone number (long integer, contains area code and does not include special characters such as '(', ')', or '-' . Assume each...

  • language:python VELYIEW Design a program that you can use to keep information on your family or...

    language:python VELYIEW Design a program that you can use to keep information on your family or friends. You may view the video demonstration of the program located in this module to see how the program should function. Instructions Your program should have the following classes: Base Class - Contact (First Name, Last Name, and Phone Number) Sub Class - Family (First Name, Last Name, Phone Number, and Relationship le. cousin, uncle, aunt, etc.) Sub Class - Friends (First Name, Last...

  • Write a program that uses a structure to store the following data about a customer account: Name Address City, sta...

    Write a program that uses a structure to store the following data about a customer account: Name Address City, state, and ZIP Telephone number Account Balance Date of last payment The program should use an vector of at least 20 structures. It should let the user enter data into the vector, change the contents of any element, and display all the data stored in the array. The program should have a menu-driven user interface. Input Validation: When the data for...

  • In the Python interpreter window (aka IDLE), create five variables: street, number, city, state, zip. street...

    In the Python interpreter window (aka IDLE), create five variables: street, number, city, state, zip. street will hold your street name, number will hold your house number, city will hold your city, state will hold your state, and zipcode will hold your zip code. Print your address in the standard format for mailing addresses. Your print statements will utilize the variable names. Take a screenshot of the IDLE window. It should show your assignment of values to the variables, your...

  • In this lab assignment, you'll write code that parses an email address and formats the ci and zip...

    Using Microsoft Visual Studio C# In this lab assignment, you'll write code that parses an email address and formats the ci and zip code portion of an address. String Handling Email: [email protected] Parse City: Fresno State: ca Zp code: 93722 Format ให้ 2 Parsed String Formatted String User name: anne Domain name: murach.comm City, State, Zip: Fresno, CA 93722 OK OK Create a new Windows Forms Application named StringHandling and build the form as shown above. 1. Add code to...

  • Write in C++ please: Write a class named MyVector using the following UML diagram and class...

    Write in C++ please: Write a class named MyVector using the following UML diagram and class attribute descriptions. MyVector will use a linked listed instead of an array. Each Contact is a struct that will store a name and a phone number. Demonstrate your class in a program for storing Contacts. The program should present the user with a menu for adding, removing, and retrieving Contact info. MyVector Contact name: string phone: string next: Contact -head: Contact -tail: Contact -list_size:...

  • (JAVA) Using classes and inheritance, design an online address book to keep track of the names

    (JAVA)Using classes and inheritance, design an online address book to keep track of the names, addresses, phone numbers and birthdays of family members, friends and business associates. Your program should be able to handle a maximum of 500 entries.Define the following classes: Class Address to store a street name, city, state and zip code. Class Date to store the day, month and year. Class Person to store a person's last name and first name. Class ExtPerson that extends the class...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT