Let's say I have the following list:
L=[ [0,1,1,1],[1,0,1,1],[1,1,0,1],[1,1,1,0] ]
I want to write code, take such a list and say whether the number "1s" in each separate list is equal to some number x. Therefore, if I typed the code (L, 3), return will be "True", because each list from L contains 3 '1s'. But if I entered the code (L, 2), then the return would be "False". I am new to all programs, so I'm sorry that my question is hard to understand. Any help would be appreciated.
source share