Skip to content

TypeScript code snippet – 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")
   print("Elements are not equal")
See also  CSS code snippet - How to stilize title property ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.