dimanche 17 mai 2015

What does the builtin function any() do?

I did some google searching on how to check if a string has any elements of a list in it and I found this bit of code that works:

if any(i in string for i in list):

I know this works, but I don't really know why. Could you share some insight?

Aucun commentaire:

Enregistrer un commentaire