In [4]: mat = [ [(4,4),(1,6)] , [(6,1),(2,2)] ]
In [6]: c,d=mat[0][0] #here mat[0] is [(4,4),(1,6)], invoking [0] on this yields [4,4]
In [7]: c
Out[7]: 4
In [8]: d
Out[8]: 4
In [9]: a,b=mat[1][1] #here mat[1] is [(6,1),(2,2)], invoking [1] on this yields [2,2]
In [10]: a
Out[10]: 2
In [11]: b
Out[11]: 2
相关问题 更多 >
编程相关推荐