>>> assert len(unique_characters) <= 10, 'Too many letters'
Traceback (most recent call last):
File "<pyshell#35>", line 1, in <module>
assert len(unique_characters) <= 10, 'Too many letters'
NameError: name 'unique_characters' is not defined
>>>
抛出异常并提供描述信息
等价于
if len(unique_characters) > 10:
raise AssertionError('Too many letters')