条件过滤
-
Python数组条件过滤filter函数使用示例
使用filter函数,实现一个条件判断函数即可。 比如想过滤掉字符串数组中某个敏感词,示范代码如下: #filter out some unwanted tags def passed(item): try: return item != …
使用filter函数,实现一个条件判断函数即可。 比如想过滤掉字符串数组中某个敏感词,示范代码如下: #filter out some unwanted tags def passed(item): try: return item != …