acronym exercise

This commit is contained in:
Xevion
2019-07-13 17:39:48 -05:00
parent 74f8471f61
commit 3a445d81aa
4 changed files with 103 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
import string, re
def abbreviate(words):
return ''.join(word.strip(string.punctuation)[0] for word in re.split(r'[\s-]+', words)).upper()