pythonchallenge 解谜 Level 1
2016-05-16 23:46
295 查看
得到第一关地址后可以进行第一关的解析了。
看起来好神秘的样子。但是也就是把字母 k 变成 m , o 变成 q ,e 变成 g。将字母对应的ASCII的值+2就行了。
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.
这就是经过解密后的话了。
貌似,这个作者并不希望我们使用这个方法。。。额。。。我的内心几乎是崩溃的。。。
不过,还是来一遍的好~
关于函数的介绍请看此链接
所以可以得到下一个网址(就是把map按照规则进行变形为ocr)
晚安~
看起来好神秘的样子。但是也就是把字母 k 变成 m , o 变成 q ,e 变成 g。将字母对应的ASCII的值+2就行了。
#-*- coding:utf-8 -*- #代码版本均为python 3.5.1 #Level 1 str = "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." def decode(i): """通过函数方法把i的值处理 注意在ASCII中小写字母的范围 使用函数ord() chr() 函数内容可以优化,我懒得动了。 """ if ord(i)>=ord("a") and ord(i)+2<=ord("z"): return chr(ord(i)+2) elif i=="y" or i=="z": return chr(ord(i)+1-ord("z")+ord("a")) else : return i for i in str: print (decode(i),end="")
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.
这就是经过解密后的话了。
貌似,这个作者并不希望我们使用这个方法。。。额。。。我的内心几乎是崩溃的。。。
不过,还是来一遍的好~
# -* - coding: UTF-8 -* - #代码版本均为python 3.5.1 #Level 1 import string str1 = "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." str2 = "map" table = str.maketrans(string.ascii_lowercase,string.ascii_lowercase[2:]+string.ascii_lowercase[:2]) #相信这个切片还是能够理解的 print (str1.translate(table)) print (str2.translate(table))
关于函数的介绍请看此链接
http://blog.csdn.net/wirelessqa/article/details/23793127
所以可以得到下一个网址(就是把map按照规则进行变形为ocr)
http://www.pythonchallenge.com/pc/def/ocr.html
晚安~
相关文章推荐
- 文成小盆友python-num2 数据类型、列表、字典
- python数据分析之numpy初始化(一)
- python 中的map(), reduce(), filter
- python学习-day2
- python处理大数据
- Ubuntu下用pyenv进行python环境隔离
- 基于Python的朴素贝叶斯算法实现
- 动态内容爬虫
- python Image模块学习
- Python3写简单爬虫
- Python-----格式化字符
- leetcode(10),Roman to Integer(python)
- Python 格式化字符串
- Python点滴(五)-pandas进阶
- Windows下Eclipse+PyDev安装Python开发环境
- python中模拟进行ssh命令的执行
- python中模拟进行ssh命令的执行
- python
- python学习笔记4-python文件操作
- Python数据处理相关小例编程