vendredi 23 juin 2017

Python 3 if not condition simplification

Are these two condition checks the same? I can't think of how to check if they are the same

l1 = []
l2 = []

if not l1 and not l2:
    print ('y')

if not (l1 and l2):
    print ('y')

Aucun commentaire:

Enregistrer un commentaire