Function Name: isContained() Parameters: myList (list ), otherList (list) Returns: True or False (bool) Description: You
Posted: Mon Jun 06, 2022 1:51 pm
Function Name: isContained() Parameters: myList (list ), otherList (list) Returns: True or False (bool) Description: You and your roommates are throwing a party to celebrate the start of summer. You each individually made a list of friends you want to invite, and you now want to make one big list for invites. However, you think that some of the lists your friends gathered could be sublists of your list. Write a function that checks whether otherList is contained in myList. otherList is contained in myList if all of its elements are present in myList in the same consecutive order. Note: If two lists are equal, they are contained in one another. Additionally, if a list is empty, it is al- ways contained in the other. >>> myList = ["Ankita", "Anupama","Claire", "Karthik", "Keke", "Rod"] >>> otherList = ["Claire", "Karthik", "Keke"] >>> isContained (myList, otherList) True >>> myList["Arvin", "Arushi", "Naomi", "Michael", "Nikhila", "Assata"] >>> otherList = ["Arushi", "Naomi", "Assata", "Nikhila"] >>> isContained (myList, otherList) False