What\'s the easiest way to check if a string only contains certain specified characters in Python? (Without using RegEx or anything, of course)
Specifically, I have
I will assume your reluctance for regexp is not really an issue :
strings = ['aba', 'acba', 'caz'] given = "abc" filter(lambda value: re.match("^[" + given + "]$", value), strings)