Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logic In Databases International Workshop Lid 96 San Miniato Italy July 1 2 1996 Proceedings Lncs 1154

Authors: Dino Pedreschi ,Carlo Zaniolo

1st Edition

3540618147, 978-3540618140

More Books

Students also viewed these Databases questions

Question

Why is the benefi ts owner important?

Answered: 1 week ago

Question

Describe the nature of negative messages.

Answered: 1 week ago