2014年3月18日

【python】比较字符串中不同的地方

摘要: 题目来自 hacker.org 的Challenge 'Didactic Text' [Crypto]分析给出的文章,找出暗语。Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all the men are created equal.Now we are engaged in a great civil war, testing 阅读全文

posted @ 2014-03-18 20:55 电子幼体 阅读(4023) 评论(0) 推荐(0) 编辑

【python】将01组成的密码用ASCII编码成字符串

摘要: 题目来自 hacker.org 的Challenge 'Didactic Bytes' [Crypto]给出一个01串组成的密码,求出破译后的单词01110101 01110011 01100101 00100000 01110111 01100101 01100100 01101110 01100101 01110011 01100100 01100001 01111001 00100000 01100110 01101111 01110010 00100000 01110100 01101000 01100101 00100000 01100001 01101110 011 阅读全文

posted @ 2014-03-18 19:20 电子幼体 阅读(786) 评论(0) 推荐(0) 编辑

【python】统计文本中出现最多次的单词

摘要: 题目来自 hacker.org 中的Challenge '3280' [Coding] 。要求找出RFC 3280 中出现次数最多的长度为9的单词。将 RFC 3280 的文本并保存到本地后用如下代码进行处理。----import retext = open("in.txt",'r').read()words = re.split('[^a-zA-Z]',text) di = {}for word in words: if len(word)==9: di.setdefault(word,0) di[word]+=1res = 阅读全文

posted @ 2014-03-18 18:46 电子幼体 阅读(1320) 评论(0) 推荐(0) 编辑

导航