8 lines
165 B
Python
8 lines
165 B
Python
|
import re
|
||
|
|
||
|
def count_letters(string):
|
||
|
try:
|
||
|
assert bool(re.match('^\w+$', string))
|
||
|
return len(string)
|
||
|
except AssertionError:
|
||
|
return -1
|