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")
how to check is all the values in a list are same or not
num = [1,1,1,1,1,1] result = num.count(num[0]) == len(num) if (result): print(True) else: print(False)