Answers for "how to check if there is similar items in two lists python"

5

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")
Posted by: Guest on August-05-2020
-2

list of single item repeated python

list_of_lists = [[] for _ in range(4)]
Posted by: Guest on December-20-2021

Code answers related to "how to check if there is similar items in two lists python"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language