Question: Python class and recurrsion Problem 2 Write a menu driven program that depicts the following library operations. There should be a book class with instance
Python class and recurrsion

Problem 2 Write a menu driven program that depicts the following library operations. There should be a book class with instance variables (price, author and any other attributes which are suitable).The menu options should be: 1. Add book information 2. Display book information 3. List all books of given author 4. Return the sum, average, maximum and minimum of book prices stored in your file. 6. Exit Each menu should call separate function to perform an operation. For option 1, 2 and 3, you must use file handling Problem 3 You are to implement a string compression algorithm with the following specifications: If a character, ch, occurs n times in a row, then it will be represented by {ch}{n), where {n} is a value of n. For example is there is a substring "aaaa" it would be represented as "a4. If a character, ch occurs exactly one time in a row, then it will be simply represented as {ch}. For example, if the substring is "a", then it will be represented as "a". Create a function RLE() to implement this algorithm recursively, this function should take in a string message and return the compressed string as an output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
