Recipe 1.8. Checking Whether a String Contains a Set of Characters(Python Cookbook)
摘要:
maketransCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1intab="aeiou"2outtab="12345"3fromstringimportmaketrans4trantab=maketrans(intab,outtab)5s="thisisastringexample...wow!"6prints.translate(trantab)7th3s3s1str3ng2x1mpl2...w4w![代 阅读全文
posted @ 2010-12-20 22:18 Ray Z 阅读(362) 评论(0) 推荐(0)
浙公网安备 33010602011771号