+ 1
How does the function insert work with an argument involving matrices?
For example: x = [ [1,2,3], [4,5,6] ] x.insert ([0][1],7) should insert 7 in place of the 2. Whats the correct syntax for this command?
2 Respuestas
+ 3
iicey
insert function will insert new item on a particular index, it will not replace already exist value.
to replace do this:
x[0][1] = 7
+ 1
Awesome! Thank you