-
Search
-
Categories
-
Recent Posts
-
Recent Comments
- thesis: Your perfect topic referring to this good post comes parallel with the dissertation work. So, you can even work for dissertation service.
- cheap tires: great website design.
- NunezPATSY24: I think that to receive the loans from creditors you must present a firm reason. Nevertheless, one time I have got a term loan, just because I was willing to buy a car. [WORDPRESS HASHCASH] The poster sent us '0 which is not a hashcash value.
- MamieCummings28: This is perfect that we are able to take the mortgage loans moreover, that opens up new chances. [WORDPRESS HASHCASH] The poster sent us '0 which is not a hashcash value.
- baby stroller: 博主好久没有更新了啊
- 宁波网站设计: 就是,太贵了吧,那可是有点亏了。
- centeur: 哈哈,我也遇到了,在sedo挂了几个域名出售,结果就收到了跟你类似的诈骗邮件。
- hex nuts: 被人宰了,要这么贵啊
- buy custom essay papers: Do you see that you do great research just about this good topic. Keep on doing it! I buy essays just about it at the the essay writers. [WORDPRESS HASHCASH] The poster sent us '0 which is not a hashcash value.
- custom essay websites: Lots of essay writing software connecting with could be created for people which wanna to have knowledge very hot article close to to terms. [WORDPRESS HASHCASH] The poster sent us '0 which is not a hashcash value.
-
Archives
-
Meta
Category Archives: python学习
python Challenge第三题
第三题给的提示是这样的:One small letter, surrounded by EXACTLY three big bodyguards on each of its sides.每个小字母的左右两侧各有三个大字字母。找出所有这样的小写字母,就胜利了。 第三题的地址:http://www.pythonchallenge.com/pc/def/equality.html 根据这样的描述,我首先想到的就是正则的环视。左三个右三个:(?<=[A-Z]{3})[a-z](?=[A-Z]{3}) 但是这个正则又会匹配上AAAAAAaAAA或者AAAaAAAAAA这样的字符串。 接着改:(?<=([^A-Z]|\b)[A-Z]{3})[a-z](?=[A-Z]{3}([^A-Z]|\b)),用到了元字符\b。括号会‘记住’它们包含的子表达式匹配的内容,我们需要‘记住’的只是[a-z],所以最终版本的正则是这样的: (?<=(?:[^A-Z]|\b)[A-Z]{3})[a-z](?=[A-Z]{3}(?:[^A-Z]|\b)) python代码是: 结果:’linkedlist’ 本次学习到的主要是正则的环视,以及(…)、(?:…)的使用。
Python Challenge第二关
连续两天加班到11点,也是一件挺累的事。忙中偷闲,做了下Python Challenge的第二题,很快就做完了,正好是这几天看了些正则的东西。 第二题的提示很简单: recognize the characters. maybe they are in the book, but MAYBE they are in the page source. ok,是让我们看page source,源码最后面有一段一千多行的字符串,就是像这样的:%%$@_$^__#)^)。 还有一段提示是这样的:find rare characters in the mess below。 先把这段长长的字符串保存到一个txt中,然后解析。源码如下: 运行python ocr.py,结果为: lyoe@ubuntu:~$ python ocr.py [‘e’, ‘q’, ‘u’, ‘a’, ‘l’, … Continue reading
Python Challenge第一关
学习一门编程语言最好的方法,就是动手写代码。 Python Challenge可以算是一个很有‘恶趣味’的网站,一共33关,每一关都是一道题,解对了就能得知下一道题的地址。 level 0:Click here to get challenged 计算2的38次方。 2**38 274877906944L ok,进入Level 1:http://www.pythonchallenge.com/pc/def/274877906944.html 跳转到http://www.pythonchallenge.com/pc/def/map.html 一幅图:K->M,O-Q,E-G; 一段乱码: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 … Continue reading