使用pop从2D数组中删除元素

Gaa*_*ara 3 python list

在下面的随机数组中:

a = [[1,2,3,4],
     [6,7,8,9]] 
Run Code Online (Sandbox Code Playgroud)

你能告诉我如何删除特定位置的元素吗?例如,我该如何删除a[1][3]?

我理解list.pop这里仅用于列表类型DS.

nat*_*ill 6

简单,只需弹出列表项.

>>> a = [[1,2,3,4], [6,7,8,9]]
>>> a[1].pop(3)
>>> a
[[1, 2, 3, 4], [6, 7, 8]]
Run Code Online (Sandbox Code Playgroud)