docstring fiddling

This commit is contained in:
Mark Pilgrim
2009-03-29 18:16:12 -05:00
parent 4b4180a8f6
commit 62b848996c
+6 -6
View File
@@ -1,13 +1,13 @@
"""Find solutions to alphametic equations.
>>> alphametics.solve('SEND + MORE == MONEY')
'9567 + 1085 == 10652'
"""
import re
import itertools
def solve(puzzle):
'''Find solutions to alphametic equations.
>>> solve('SEND + MORE == MONEY')
9567 + 1085 == 10652
'''
words = re.findall('[A-Z]+', puzzle)
unique_characters = set(''.join(words))
assert len(unique_characters) <= 10