« Python : Operateurs logiques » : différence entre les versions
De www.yakakliker.org
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 38 : | Ligne 38 : | ||
}); | }); | ||
</script> | </script> | ||
</html> | |||
<html> | |||
<a href="https://www.compteurdevisite.com" title="compteur web gratuit sans pub"><img src="https://counter6.optistats.ovh/private/compteurdevisite.php?c=b4epghealnwlf7wuq7gn3ygll9aywrfx" border="0" title="compteur web gratuit sans pub" alt="compteur web gratuit sans pub"></a> | |||
</html> | </html> |
Dernière version du 17 février 2025 à 18:21
L'opérateur and
print(True and True) # True
print(True and False) # False
print(False and True) # False
print(False and False) # False
L'opérateur or
print(True or True) # True
print(True or False) # True
print(False or True) # True
print(False or False) # False
L'opérateur not
print(not 1) # False
print(not 'a') # False
print(not 0) # True
print(not None) # True
print(not "") # True
print(not {}) # True
print(not []) # True
print(not False) # True