Reference no: EM132356333
In this exercise you will implement a program for a user to manipulate a readinglist.
• Define a function called print Menu that prints the followingchoices :
o List all (L)
o Add (A)
o Number of books (N)
o Remove (R)
o Insert (I)
o Quit (Q)
• Define a function called print List that takes in a list as a parameter and prints the entries in the listone entry per line. If the listisempty, have the program print «No titles in the list »
• In the program do the following :
1. Createa list called reading List with two books : « Catch 22 » and « Time Machine »
2. Print a greeting message to the user
3. Call the printMenufunctionaboveto display the menu
4. Getuser'schoice.
5. Do thefollowingaccording to user input :
o If the user chooses «L » or « l », call the print List function with reading List as the argument and go back to step 3.
o If the user chooses « A » or « a », ask the user the title of the book,addit to the end of the readingList and go back to step 3.
o If the user chooses « N » or « n », print the number of books in readingList and go back to step 3.
o If the user chooses « R » or « r », the program asks the user for a book title ; and removesitfrom the list if itis in the list. If itis not in the list, then the program says«The given book titleis not in the readinglist ».
o If the user chooses « I » or « i », the program asks the user for a book title. If the titleis in the list, itsays « The titleisalready in the list », otherwise, itasks for the index to insert the title at. If the index isinvalid (leesthanzero or greaterthan the length of the list), then the program says « Invalid index. Enter index again ». It continues thisprocessuntil the user enters a valid index. Once the user enters a valid index, it inserts the title at the given index.
o If the user chooses « Q » or « q », print « Bye » and go tostep6.
o If the user choosesanyhtingelse, tell the user to enter theirchoiceagain and go back to step 3.
6. Print « End of program » on the screen
What to submit?
1. Make sure that your programs run correctly on various inputs.
2. Document and style your program properly.
3. Save your file as FirstNameLastNameL20.py. Save a screenshot of the output as FirstNameLastNameL20.png
4. Submit the file in the dropbox for Lab 20