pythonchallenge 解谜 Level 2

it2022-05-09  26

好吧,赶紧贴一下。

1 #-*- coding:utf-8 -*- 2 #代码版本均为python 3.5.1 3 #Level 2 4 5 import re 6 file = open("Level 2.txt","r") 7 for line in file.readlines(): 8 chars = ' '.join(re.findall(r'[a-z]|[A-Z]|[0-9]',line)) 9 print (chars,end="")

代码挺简单的,可以试着从网页中直接获取,那段文件代码。

这个。。。你们可以自己写。我就懒得写了。

使用正则,findall进行匹配。

最后顺利输出的到

equality

所以,顺利进入下一关。

http://www.pythonchallenge.com/pc/def/equality.html

 

转载于:https://www.cnblogs.com/qipa/p/5500177.html


最新回复(0)