现在的位置: 首页 > 综合 > 正文

python challenge 第二关最简解法 http://www.pythonchallenge.com

2013年11月04日 ⁄ 综合 ⁄ 共 375字 ⁄ 字号 评论关闭

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

下面是python chanllenge第二关的解法:

打开网页http://www.pythonchallenge.com/pc/def/ocr.html后,查看该网页源码,找出

<!--
  find rare characters in the mess below:
  -->

上面代码的下面有一段在<!-- -->标签中的字符串,将其赋值给变量s

result = ''.join(re.compile('[a-z]').findall(s))

result 的结果为 equality

最终第三关的网页地址也就出现了:

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


当然,如果想要完全使用python脚本来得出结果,就各位自己努力吧。

抱歉!评论已关闭.