本文實例講述了python過濾字符串中不屬于指定集合中字符的類。分享給大家供大家參考。具體如下:
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # -*- coding: utf-8 -*- import sets class Keeper(object): def __init__(self, keep): self.keep = sets.Set(map(ord, keep)) de希望本文所述對大家的Python程序設計有所幫助。
新聞熱點
疑難解答