SyntaxFix
Write A Post
Hire A Developer
Questions
You can also use any(), map() like so:
any()
map()
if any(map(l.startswith, x)): pass # Do something
Or alternatively, using a generator expression:
if any(l.startswith(s) for s in x) pass # Do something