I need to validate if my list of list has equally sized lists in python
myList1 = [ [1,1] , [1,1]] // This should pass. It has two lists.. both of length 2 m
You could try:
test = lambda x: len(set(map(len, x))) == 1 test(myList1) # True test(myList4) # False
Basically, you get the length of each list and make a set from those lengths, if it contains a single element then each list has the same length