擅长:python、mysql、java
<p>1)与unescape等价的python在python2.x系列中是<a href="http://docs.python.org/library/urllib.html#urllib.unquote" rel="nofollow">urllib.unquote()</a>,在python3.x系列中是{a2}</p>
<p>2)你猜最简单的方法就是做<code>x = 7</code></p>
<p>3)在字符串宪章上循环的最简单方法是执行<code>for c in string:</code>,但是要有一个您应该做的索引<code>for i,c in enumerate(string):</code></p>
<p>4)该字符串.charChodeAt(c) 与chr(c)相同</p>
<p>最后,我将复制循环部分,如下所示:</p>
<pre><code>result = []
for i,c in enumerate(string):
result.append(chr(ord(c)^(x if i%2 else 0)))
print("".join(result))
</code></pre>
<p>事实上,由于字符串不会发生变化,因此使用临时数组来生成appends比处理字符串更有效</p>