|
|
发表于 2016-3-29 10:34:26
|
显示全部楼层
略用一些英文基础知识可以解答出来,还蛮有意思的
代码如下:- data = 'oz oa q zsxzi xhoctsaqkkn qelhgvktrutr, ziqz q aohukt jqh oh fgaataaogh gy q uggr ygszxht,\
- jxaz wt oh vqhz gy q voyt. igvtcts kozzkt lhgvh zit yttkohua gs cotva gy\
- axei q jqh jqn wt gh ioa yosaz thztsohu q htouiwgxsiggr, zioa zsxzi oa ag vtkk yobtr\
- oh zit johra gy zit axssgxhrohu yqjokota, ziqz it oa eghaortstr\
- zit souizyxk fsgftszn gy agjt ght gs gzits gy zitos rqxuiztsa.'
- my_dict = {'q':'a', 'o':'i', 'z':'t', 'a':'s', 'i':'h','x':'u','s':'r','g':'o',
- 'y':'f', 'e':'c', 't':'e', 'h':'n', 'v':'w', 'c':'v','u':'g','w':'b',
- 'l':'k', 'k':'l', 'n':'y', 'r':'d', 'f':'p', 'j':'m', 'b':'x'}
- new_data = ''
- for each_item in data:
- if each_item in my_dict.keys():
- new_data += my_dict[each_item]
- else:
- new_data += each_item
- print(new_data)
复制代码
得到的这段话是:
- it is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife. however little known the feelings or views of such a man may be on his first entering a neighbourhood, this truth is so well fixed in the minds of the surrounding families, that he is considered the rightful property of some one or other of their daughters.
复制代码 |
评分
-
查看全部评分
|