« Python : If, elif & else » : différence entre les versions
De www.yakakliker.org
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 31 : | Ligne 31 : | ||
}); | }); | ||
</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:18
Exemple :
a = 10
if a > 50:
print('Supérieur à 50')
elif a > 20:
print('Supérieur à 20')
elif a > 5:
print('Supérieur à 5') # Cette instruction sera exécutée
else:
print('Inférieur à 5')