SyntaxFix
Write A Post
Hire A Developer
Questions
Simpler approach? A little more Pythonic?
>>> ok = "0123456789abcdef" >>> all(c in ok for c in "123456abc") True >>> all(c in ok for c in "hello world") False
It certainly isn't the most efficient, but it's sure readable.