I'm trying to check is any item of a list starts with a certain string. How could I do this with a for loop? IE:
anyStartsWith = False
for item in myList:
if item.startsWith('qwerty'):
anyStartsWith = True
Use any()
:
any(item.startswith('qwerty') for item in myList)