How can I get length of random Matrix(except last element in every row), for example:
x=[['1', '7', 'U1'], ['1.5', '8', 'U1'], ['2', '5.5', 'U2']]
I know that for length Python use “len(x)“, but it’s not correct
Result must be in this case 6 (last element on every row not count)
thanks
sum(len(xx) - 1 for xx in x)should work.