weight(L)
Computes the Hamming weight of a list L, which is the number of its non-zero entries.
i1 : weight({1,0,1,0,1}) o1 = 3
i2 : weight({0,123,48,0,256}) o2 = 3
The object weight is a method function.