Jul-18-2018, 06:14 AM
(Jul-17-2018, 04:32 PM)micseydel Wrote: I think perfringo has the right idea, but that wouldn't capture double-quotes ("
). I would suggest a whitelist rather than a blacklist
from string import letters # [...] letter_count = len(char for char in chars if char in letters)
Whitelisting is definitely way to go! It is much better to allow specific set of letters instead of trying to guess what clever symbols users might enter.
It seems to me, that there is no 'letters' in string.py. I get
ImportError: cannot import 'letters' from 'string'
. Shouldn't it be:from string import ascii_letters
?
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.