六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 134|回复: 0

Python Challenge笔记

[复制链接]

升级  32%

4

主题

4

主题

4

主题

童生

Rank: 1

积分
16
 楼主| 发表于 2013-2-7 19:47:15 | 显示全部楼层 |阅读模式
http://www.pythonchallenge.com/pc/def/map.html
图片中提示 K->M  O->Q  E->G
下面给了一段话 看起来是加密过了的 根据提示可以知道 每个字母后移了2位
使用string和maketrans可以解决此问题
解密出来的文字提示使用这个规律解密地址 将map解密后得到 ocr即下一关地址
http://www.pythonchallenge.com/pc/def/ocr.html

>>> import string>>> l = string.lowercase>>> t = string.maketrans(l, l[2:] + l[:2])>>> m = """g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gqglcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmuynnjw ml rfc spj.""">>> print m.translate(t)i hope you didnt translate it by hand. thats what computers are for. doing it in by hand isinefficient and that's why this text is so long. using string.maketrans() is recommended. nowapply on the url.>>> print "map".translate(t)ocr
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表