In this program, we will take two lists as inputs and check whether the list contains a sublist with the help of the below-given steps.
List contains a sublist:
Steps to solve the program
- Take two lists as input.
- Check whether list2 is a sublist of list1 (i.e. all the elements from the list2 are in list1.
- Use for loop for this purpose.
- Print the output.
Output :
Related Articles
Python program to generate all sublists with 5 or more elements in it from the given list.
Python program to find the second largest number from the list.
Python program to find the second smallest number from the list.
Python program to merge all elements of the list in a single entity using a special character.
Python program to get the difference between two lists.
Python program to reverse each element of the list.