« 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')

Liens

https://dyma.fr/developer/list/chapters/core/61969e0166ef0d5e68f7f647/lesson/python/619801296638f0c94cbbe6c0/3/2


compteur web gratuit sans pub