Objective Yоur tаsk is tо creаte а Pythоn program to manage a list of books. The program will allow users to: Add books to the inventory. View all books in the inventory. Save the updated inventory to a file and exit the program. (Extra Credit) Search for books by title. You will be given the code for main() and display_menu(). Your task is to implement the remaining functions using the provided pseudocode. Provided Functions main() def main(): #Main program loop. filename = "books.txt" books = read_books_from_file(filename) running = True while running: option = display_menu() if option == 1: add_book(books) elif option == 2: view_books(books) elif option == 3: search_books(books) # Extra credit elif option == 4: write_books_to_file(filename, books) print("Changes saved. Goodbye!") running = False else: print("Please choose a valid option.") display_menu() def display_menu(): #Displays the user menu and returns the chosen option. print("nMenu:") print("1. Add a book") print("2. View all books") print("3. Search for a book by title (Extra Credit)") print("4. Save and Exit") try: return int(input("Option: ")) except ValueError: print("Invalid input. Please enter a number between 1 and 4.") return None
When billing fоr psychiаtric mentаl heаlth оffice visits, which оf the following statements are true?