一行代码python

不含有888的返回

    list_str = ["11_888_12", "11_888_2", "11_777_12"]
    bb = [x for x in list_str if '888' not in x]
list_str = ["11_888_12", "11_888_2", "11_777_12"]
list_str_np = np.array(list_str)
aa = list_str_np[list(map(lambda x: "888" not in x, list_str_np))]
posted @ 2023-07-21 16:41  无左无右  阅读(3)  评论(0编辑  收藏  举报