1## checking any elment of list_B in list_A
2list_A = [1, 2, 3, 4]
3
4list_B = [2, 3, 6]
5
6check = any(item in list_A for item in list_B)
7
8print(check)
9# True
1## checking all elements of list_B in list_A
2list_A = [1, 2, 3, 4]
3list_B = [2, 3]
4
5check = all(item in list_A for item in list_B)
6
7print(check)
8# True
1##Taking examples of two python lists.
2
3##Take examples of two lists.
4
5list1 = [2,4,0,7,6]
6list2 = [1,0,9,7,6]
7
8##the statement for condition is.
9
10check = any(element in list2 for element in list1)
1# checking all elements of list_B in list_A
2list_A = [1, 2, 3, 4]
3list_B = [2, 3]
4
5check = any(item in list_A for item in list_B)
6
7print(check)
8# True