python check if all elements in two lists are the same code example
Example 1: python how to check if all elements in list are the same
List = ['Mon','Mon','Mon','Mon']
// Result from count matches with result from len()
result = List.count(List[0]) == len(List)
if (result):
print("All the elements are Equal")
else:
print("Elements are not equal")
Example 2: python same values in two lists
a = {1, 2, 3, 4}
b = {3, 4, 5, 6}
a.intersection(b)