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的更多相关文章

  1. python challenge - orc.py

    http://www.pythonchallenge.com/pc/def/ocr.html recognize the characters. maybe they are in the book, ...

  2. Python【map、reduce、filter】内置函数使用说明(转载)

    转自:http://www.blogjava.net/vagasnail/articles/301140.html?opt=admin 介绍下Python 中 map,reduce,和filter 内 ...

  3. 【转】Python 中map、reduce、filter函数

    转自:http://www.blogjava.net/vagasnail/articles/301140.html?opt=admin 介绍下Python 中 map,reduce,和filter 内 ...

  4. python challenge第1关--NoteBook上的“乱码”

    在 python challenge第0关中已经得到第1关的地址了: http://www.pythonchallenge.com/pc/def/map.html 一.观察地址栏和标签: What a ...

  5. The Python Challenge 谜题全解(持续更新)

    Python Challenge(0-2) The Python Challengehttp://www.pythonchallenge.com/ 是个很有意思的网站,可以磨练使用python的技巧, ...

  6. The Python Challenge 0-4

    The Python Challenge 0-4 项目地址:http://www.pythonchallenge.com/ Level-0 提示Hint: try to change the URL ...

  7. 使用Python实现Map Reduce程序

    使用Python实现Map Reduce程序 起因 想处理一些较大的文件,单机运行效率太低,多线程也达不到要求,最终采用了集群的处理方式. 详细的讨论可以在v2ex上看一下. 步骤 MapReduce ...

  8. Python Challenge 第一关

    偶然在网上看到这个,PYTHON CHALLENGE,利用Python语言闯关,觉得挺有意思,就记录一下. 第0关应该算个入口吧,试了好几次才试出来,没什么代码就不写了.计算一个结果出来就行. 第一关 ...

  9. The Python Challenge 闯关笔记

    The Python Challenge : http://www.pythonchallenge.com/ Level 0: 看提示图片中为2**38,计算值为274877906944. Hint: ...

随机推荐

  1. (十一)数组array

    变量:只能存一个值,数组可以存多个值 (1)普通数组,索引下标是整数: 1)定义: 方法一:一次赋一个值:语法:数组名[下标]=变量值 array[1]=linux array[2]=shell 方法 ...

  2. 隐藏tomcat版本号

    找到catalina.jar, cd /usr/local/tomcat/lib 解压catalina.jar unzip catalina.jar 会生成两个目录 修改配置文件:org/apache ...

  3. (寒假开黑gym)2018 USP Try-outs

    layout: post title: (寒假开黑gym)2018 USP Try-outs author: "luowentaoaa" catalog: true tags: m ...

  4. IDL软件初步了解

    软件名称:IDL(交互式数据语言Interactive Data Language) 软件类别:是国产软件,语言类,数据分析类,数据可视化类 语言类别:解释型 作用:可以进行数据处理的可视化等,在大数 ...

  5. 排排看(p20)

    public class paixu{public static void main(String[] args){int x=3;if(x>2){System.out.print(" ...

  6. 使用shell生成随机数

    #!/bin/bash $` do $` do s=$(($RANDOM%)) done done 第1行:#!/bin/bash是指此脚本使用/bin/bash来解释执行.其中,#!是一个特殊的表示 ...

  7. Android Studio 下使用git -- 个人,本地版本控制

    第一步:下载安装git 下载地址 : https://git-scm.com/downloads 第二步:Android Studio 下配置git路径. 配置之后,Test弹出如下成功的提示即可. ...

  8. Zookeeper的功能以及工作原理(转)

    本文转自https://www.cnblogs.com/felixzh/p/5869212.html Zookeeper的功能以及工作原理   1.ZooKeeper是什么?ZooKeeper是一个分 ...

  9. 重新学习vue基础

    1.创建vue实例 var vm = new Vue({ el: '#example', //选择元素 data: {a:1} //基本数据 }) 2.模板语法 (一)基本语法 <span> ...

  10. Xamarin.Forms 调用 腾讯地图SDK

    Xamarin.Forms研究了好一段时间了,最近一直在学习中,想尝试一下调用其他的SDK,就如腾讯地图SDK(申请容易). 完成此次项目得感谢以下链接: http://www.cnblogs.com ...