Ray's playground

 

Python Challenge 1

http://www.pythonchallenge.com/pc/def/map.html

1
1 >>> s="g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."
2 >>> t = str.maketrans('abcdefghijklmnopqrstuvwxyz''cdefghijklmnopqrstuvwxyzab')
3 >>> s.translate(t)
4 "i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() is recommended. now apply on the url."
5 >>> "map".translate(t)
6 'ocr'

 

 

posted on 2009-12-16 21:48  Ray Z  阅读(284)  评论(0编辑  收藏  举报

导航