Question
Language: Python Topic: Tuples Function name : todo_tuple Parameters : todo (list of tuples of strings), completed (list of strings) Returns: final_list (list) Description :
Language: Python
Topic: Tuples
Function name : todo_tuple Parameters : todo (list of tuples of strings), completed (list of strings) Returns: final_list (list) Description : Write a function that takes in a list of tuples of strings that represents the work you have to do in each class, and a list of strings that represent the work you have already completed. Each tuple in the todo list represents the work for a single class. For this function, go through the work for class (tuple) and remove the work that you have already completed (in the completed list). Return a new list of tuples representing the modified class work without the completed work. If you finish all work for a class, do not add an empty tuple to your final list..
Notes: Your code should not allow capitalization to change the searching of the work. So for example, if read book is the work for one class, and READ BOOK is on the completed list, the work read book would be eligible to be removed. You will need to add the original casing of the work to your final list.
Test Cases:
>>> todoList = [(read psyc chapter 5, do online survey), (write meeting minutes, email client back, delete unused pictures), (look over problem set,)] >>> completedList = [read Psyc chapter 5, Look over problem set] >>> print(todo_tuple(todoList, completedList))
[(do online survey,), (write meeting minutes, email client back, delete unused pictures)]
>>> todoList1 = [(complete 1301 HW05, read online textbook), (Do STATS Worksheet, solve linear program, make Stochastic matrix), (finish chem lab, write lab report)] >>> completedList1 = [COMPLETE 1301 HW05, WRITE lab Report]
>>> print(todo_tuple(todoList1, completedList1)) [('read online textbook',), ('Do STATS Worksheet', 'solve linear program', 'make Stochastic matrix'), ('finish chem lab',)]
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