Function Name: isContained() Parameters: myList (list ), otherList (list) Returns: True or False (bool) Description: You

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Function Name: isContained() Parameters: myList (list ), otherList (list) Returns: True or False (bool) Description: You

Post by answerhappygod »

Function Name Iscontained Parameters Mylist List Otherlist List Returns True Or False Bool Description You 1
Function Name Iscontained Parameters Mylist List Otherlist List Returns True Or False Bool Description You 1 (73.66 KiB) Viewed 19 times
please solve it as python
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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply