Python 内建的 filter() 函数用于过滤序列。 和 map() 类似, filter() 也接收一个函数和一个序列。 ... 例如,在一个list中,删掉偶数,只保留奇数,可以这么写:
確定! 回上一頁