I have constructed the following script in Python 3 that does what it needs to, but, it iterates through my items twice. Is there are way to the same outcome with a single iteration?
if any(A in B for A in C): for A in C: if A in B: # Do something with A. # Order of iteration is important. break else: # Do something else
Aucun commentaire:
Enregistrer un commentaire