金沙澳门官网python中的字母转换

作者: 网络编程  发布:2019-11-14

无意之间了解到了一个很逗比的网站:

1、K -> M  O ->Q  E -> G

 

Hint:每个人在解决这个问题之前先想两次

于是就遇到了第二题,他列出了一串文本:

Text: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.

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.

每个字母的ASCII码值增加2

然后给出了下图:

金沙澳门官网 1金沙澳门官网 2

金沙澳门官网 3

# -*- coding:UTF-8 -*-

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."

# (ord(x) 2-ord('a'))&
# x的ASCII码值 2之后是第几个字母
print("".join(map(lambda x: chr(ord('a')   (ord(x) 2-ord('a')) % 26) if x.isalpha() else x, str)))

 

(1)

通过图片中的信息我们能得知,其实就是将当前字母往后移动两位。

转换之后的Text: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.

首先我先用了chr() ord()来转换:

再对url进行转换然后替代map进入下一页面:ocr.html

输出结果:

将url中的pc替换为pcc可以看到前一题的官方解

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.

本文由金沙澳门官网发布于网络编程,转载请注明出处:金沙澳门官网python中的字母转换

关键词: 金沙澳门官网