Question
Question for Python. The Dictionary is a very powerful data structure. The objective of this programming assignment is to demonstrate proficiency with dictionaries. You are
Question for Python.
The Dictionary is a very powerful data structure. The objective of this programming assignment is to demonstrate proficiency with dictionaries. You are to write a program that manages a dictionary of Frequently Asked Questions (FAQ's). Questions serve as the keys and answers serve as the values. Your program will use a menu driven interface to display the items in the dictionary, add FAQ's and optionally to delete FAQ's.
Create a program with a menu that allows the user to do the following:
When displaying the FAQ's, neatly display the questions and answers paired together as in this example:
Requirements for Menu Selection 2:
- If the question is already in the dictionary, do not overwrite it. Let the user know that the question is already in the FAQ's. Then ask the user to rephrase the question.
- Otherwise, prompt the user for the answer
- Add the question/answer pair to the dictionary using the question as the key and the answer as the value.
Requirements for Menu Selection 3 (optional):
Note that implementing menu selection 3 is for 10 points extra credit.
- Ask the user for the question to be deleted.
- Check to see if the question is in the dictionary.
- If it isn't, let the user know that the question could not be found and that no changes were made.
- Otherwise delete the item from the dictionary and let the user know that the item was deleted.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started