Python Semua elemen dalam daftar dalam daftar lain
set(['a', 'b']).issubset(['a', 'b', 'c'])
Pleasant Panda
set(['a', 'b']).issubset(['a', 'b', 'c'])
'''
check if list1 contains any elements of list2
'''
result = any(elem in list1 for elem in list2)
if result:
print("Yes, list1 contains any elements of list2")
else :
print("No, list1 contains any elements of list2")
check = all ( item in first_list for item in second_list )
# check = True - All elements from first_list are in second_list
# check = False - Not all elements from first_list are not in second_list