Aug-07-2019, 03:44 PM
Can someone look at this and tell me why this does not work....I know it is something simple as it worked 1 min and not the next. picharm is not showing any errors
print("--------------------------") print("Frequently Asked Questions") print("--------------------------") menu = """ 1: Add a Question 2: Delete a Question 3: List all FAQ 4: Exit """ FAQ = {} done = False while not done: print(menu) option = input("Please enter your selection: ") if option == 1: question = input("\nEnter a question to be added: ") answer = input("\nThe answer to the question is: ") FAQ[question] = answer print('Your FAQ has been added. ') elif option == 2: item = input("Enter question to be deleted: ") if item in FAQ: del(FAQ[item]) else: print("That question is not in the dictionary! ") elif option == 3: for item in FAQ: print("\nQuestion: ", item) print("Answer: ", FAQ[item]) print() elif option == 4: done = True print('All entries added to dictionary. \nSession is closed! ')