c5b = open('2013/5b.ciphertext').read()
c6a = open('2013/6a.ciphertext').read()
c6b = open('2013/6b.ciphertext').read()
-c7a = open('2013/6a.ciphertext').read()
-c7b = open('2013/6b.ciphertext').read()
+c7a = open('2013/7a.ciphertext').read()
+c7b = open('2013/7b.ciphertext').read()
p1a = caesar_decipher(c1a, 8)
p1b = caesar_decipher(c1b, 14)
if one_based: cipher_number += 1
plaintext_number = (
modular_division_table[multiplier]
- [(cipher_number - adder) % 26] )
+ [(cipher_number - adder) % 26])
if one_based: plaintext_number -= 1
return chr(plaintext_number % 26 + alphabet_start)
else:
>>> pe.validate_wheel_spec([])
Traceback (most recent call last):
...
- ValueError: Wheel specification has 0 pairs, require 13
+ ValueError: Wheel specification has 0 pairs, requires 13
>>> pe.validate_wheel_spec([('a', 'b', 'c')]*13)
Traceback (most recent call last):
...
>>> sorted(normalise({1: 1, 2: 2, 3: 1}).items())
[(1, 0.25), (2, 0.5), (3, 0.25)]
"""
- length = sum([f for f in frequencies.values()])
+ length = sum(f for f in frequencies.values())
return collections.defaultdict(int, ((k, v / length)
for (k, v) in frequencies.items()))
# Five minutes on StackOverflow later...
```python
+import unicodedata
+
def unaccent(text):
"""Remove all accents from letters.
It does this by converting the unicode string to decomposed compatibility