« Python : Operateurs logiques » : différence entre les versions

De www.yakakliker.org
(Page créée avec « === L'opérateur and === <syntaxhighlight lang="python3"> print(True and True) # True print(True and False) # False print(False and True) # False print(False and False) # False </syntaxhighlight> === L'opérateur or === <syntaxhighlight lang="python3"> print(True or True) # True print(True or False) # True print(False or True) # True print(False or False) # False </syntaxhighlight> === L'opérateur not === <syntaxhighlight lang="python3"> print(not 1)... »)
 
Aucun résumé des modifications
 
(Une version intermédiaire par le même utilisateur non affichée)
Ligne 28 : Ligne 28 :
[[Catégorie:Python]]
[[Catégorie:Python]]
[[Catégorie:Scripts]]
[[Catégorie:Scripts]]
‎<html>
<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script>
<script>
  kofiWidgetOverlay.draw('yakakliker', {
    'type': 'floating-chat',
    'floating-chat.donateButton.text': 'Café',
    'floating-chat.donateButton.background-color': '#00b9fe',
    'floating-chat.donateButton.text-color': '#fff'
  });
</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>

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


compteur web gratuit sans pub