python challenge - map.py
Hint: K->M O->Q E->G
everybody thinks twice before solving this.
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.
General tips:
- Use the hints. They are helpful, most of the times.
- Investigate the data given to you.
- Avoid looking for spoilers.
#!/usr/bin/env python
# http://www.pythonchallenge.com/pc/def/map.html
import string
str1 = "abcdefghijklmnopqrstuvwxyz"
str2 = "cdefghijklmnopqrstuvwxyzab"
transtr = string.maketrans(str1, str2)
aimstr = "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."
print aimstr.translate(transtr)
或
#!/usr/bin/python
# http://www.pythonchallenge.com/pc/def/map.html
import string
tr=string.maketrans(string.lowercase,string.lowercase[2:]+string.lowercase[:2])
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."
print s.translate(tr)
输出:
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.
下一关:http://www.pythonchallenge.com/pc/def/ocr.html
字符串maketrans(),translate()
python challenge - map.py的更多相关文章
- python challenge - orc.py
http://www.pythonchallenge.com/pc/def/ocr.html recognize the characters. maybe they are in the book, ...
- Python【map、reduce、filter】内置函数使用说明(转载)
转自:http://www.blogjava.net/vagasnail/articles/301140.html?opt=admin 介绍下Python 中 map,reduce,和filter 内 ...
- 【转】Python 中map、reduce、filter函数
转自:http://www.blogjava.net/vagasnail/articles/301140.html?opt=admin 介绍下Python 中 map,reduce,和filter 内 ...
- python challenge第1关--NoteBook上的“乱码”
在 python challenge第0关中已经得到第1关的地址了: http://www.pythonchallenge.com/pc/def/map.html 一.观察地址栏和标签: What a ...
- The Python Challenge 谜题全解(持续更新)
Python Challenge(0-2) The Python Challengehttp://www.pythonchallenge.com/ 是个很有意思的网站,可以磨练使用python的技巧, ...
- The Python Challenge 0-4
The Python Challenge 0-4 项目地址:http://www.pythonchallenge.com/ Level-0 提示Hint: try to change the URL ...
- 使用Python实现Map Reduce程序
使用Python实现Map Reduce程序 起因 想处理一些较大的文件,单机运行效率太低,多线程也达不到要求,最终采用了集群的处理方式. 详细的讨论可以在v2ex上看一下. 步骤 MapReduce ...
- Python Challenge 第一关
偶然在网上看到这个,PYTHON CHALLENGE,利用Python语言闯关,觉得挺有意思,就记录一下. 第0关应该算个入口吧,试了好几次才试出来,没什么代码就不写了.计算一个结果出来就行. 第一关 ...
- The Python Challenge 闯关笔记
The Python Challenge : http://www.pythonchallenge.com/ Level 0: 看提示图片中为2**38,计算值为274877906944. Hint: ...
随机推荐
- Jquery学习之路(三) 实现弹出层插件
弹出层的应用还是比较多的,登陆,一些同页面的操作,别人的总归是别人的,自己的才是自己的,所以一直以来想写个弹出层插件.不多废话,直接开始吧! 不想看可以在这里直接下载源码xsPop.zip 1:遮罩层 ...
- Allocate exception for servlet XXX 基本异常
HTTP Status 500 - Error instantiating servlet class cn.tedu.servlet 错误!! 解决方案: 查看当前项目下的web.xm文件的真 ...
- [/wp_active.php]
if ( !is_multisite() ) { wp_redirect( site_url( '/wp-login.php?action=register' ) );//将用户重定向到一个预先制定的 ...
- (2)C# 创建ef oracle
1.NUGet下载 2.下载 Oracle Developer Tools for Visual Studio https://www.oracle.com/technetwork/develope ...
- 建立新的acticity需要的注意的问题
首先需要我们在mainifests中进行注册, <activity android:name="com.special.residemenudemo.CameraActivity&qu ...
- Problem C: #104. 普通平衡树
#include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #inc ...
- Ubuntu开机启动的方式
方法一:--------------------------------------------------1. 在/etc/init.d/下放置启动脚本,比如postgresqlroot@ubunt ...
- ansible管理window
设置window以支持远程执行命令======================================= 升级powershell到3.0+-------------------------- ...
- 利用位操作进行IP地址的转化
1)IPv4地址是一个32位的二进制数,通常被分割位4个“8位二进制数”,为了方便,通常使用“点分十进制”的形式表示成(a.b.c.d)的形式,其中,a,b,c,d都是0~255之间的十进制整数,另外 ...
- Remote procedure call (RPC)
Remote procedure call (RPC) (using the .NET client) Prerequisites This tutorial assumes RabbitMQ isi ...