mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
added example of human-readable message in assert statement
This commit is contained in:
@@ -10,7 +10,7 @@ import itertools
|
||||
def solve(puzzle):
|
||||
words = re.findall('[A-Z]+', puzzle.upper())
|
||||
unique_characters = set(''.join(words))
|
||||
assert len(unique_characters) <= 10
|
||||
assert len(unique_characters) <= 10, 'Too many letters'
|
||||
first_letters = {word[0] for word in words}
|
||||
n = len(first_letters)
|
||||
sorted_characters = ''.join(first_letters) + \
|
||||
|
||||
Reference in New Issue
Block a user