Finding The Largest Number in a Nested List in Python

后端 未结 5 1493
我在风中等你
我在风中等你 2021-01-17 07:11

I would like to put the max number(s) to a new array, I\'ve tried every thing that I can think of and none seem to work....(adding to an empty result array, concat, etc)

5条回答
  •  遥遥无期
    2021-01-17 07:27

    newArray = [max(i) for i in list]
    

    search up List Comprehension, one of the most useful things about python.

提交回复
热议问题