本文實(shí)例講述了python過(guò)濾字符串中不屬于指定集合中字符的類。分享給大家供大家參考。具體如下:
?
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希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。
新聞熱點(diǎn)
疑難解答
網(wǎng)友關(guān)注