exercism-solutions/python/acronym/acronym.py
2021-06-08 17:06:38 +03:00

7 lines
159 B
Python

import re
WORD_REGEX = re.compile(r"([^\W_]+(?:'[^\W_]+)?)")
def abbreviate(words):
return ''.join(s[0].upper() for s in re.findall(WORD_REGEX, words))