当前位置: 首页 > 后端技术 > Python

【python选取满足一定条件的数据】

时间:2023-03-25 20:10:43 Python

一维数组defis_odd(n):returnn%2==1newlist=filter(is_odd,[1,2,3,4,5,6,7,8,9,10])print(newlist)[1,3,5,7,9]二维数组根据条件过滤二维数组