python 取二维数组中的最大值

版权声明:转载请说明链接~~~ https://blog.csdn.net/weixin_40546602/article/details/87987107

map函数的使用

>>> dp
[[0, 0, 0], [0, 6, 3], [0, 0, 0], [0, 19, 0], [3, 12, 5]]
>>> max(dp)
[3, 12, 5]
>>> max(max(dp))
12
>>> max(map(max,dp))
19

猜你喜欢

转载自blog.csdn.net/weixin_40546602/article/details/87987107