Quote:
m=array(([[int]*x]*x))
That creates a 6x6 array with each element initialized to
<class 'int'>
.
You only set the first three columns of the first three rows, and the first two columns of the fourth row. All other values retain their default value of
<class 'int'>
.
You then try to add an
int
to a
<class 'int'>
, which is not a supported operation.
Change your array declaration to:
m=array(([[0]*x]*x))
and your code will run successfully. Whether or not it produces the expected answer is up to you - I'd suggest you need to review your array initialization code, since you're not setting every element, and you're setting some elements twice.