fork download
  1. import string
  2. s = "А роза упала на лапу Азора"
  3. cs = list(filter( lambda x: x not in string.punctuation + string.whitespace, s))
  4. print(cs)
  5.  
  6. import re
  7. print(re.findall(r'[^\W_]', s))
Success #stdin #stdout 0.02s 27752KB
stdin
Standard input is empty
stdout
['А', 'р', 'о', 'з', 'а', 'у', 'п', 'а', 'л', 'а', 'н', 'а', 'л', 'а', 'п', 'у', 'А', 'з', 'о', 'р', 'а']
['А', 'р', 'о', 'з', 'а', 'у', 'п', 'а', 'л', 'а', 'н', 'а', 'л', 'а', 'п', 'у', 'А', 'з', 'о', 'р', 'а']