def contains_letter(text):
'''Returns whether “text” contains a “letter” type character
:param text: The text to check
:type text: string
:rtype: boolean
Examples:
>>> contains_letter('Hi!')
True
>>> contains_letter(':-)')
False
'''
for char in text:
category = unicodedata.category(char)
if category in ('Ll', 'Lu', 'Lo',):
return True
return False
评论列表
文章目录