« Python : La boucle for » : différence entre les versions

De www.yakakliker.org
(Page créée avec « <syntaxhighlight lang="python3"> for element in [1, 2, 3]: print(element) print(element) </syntaxhighlight><syntaxhighlight lang="python3"> compteur = 0 for element in 'Bonjour': compteur += 1 print(element, compteur) </syntaxhighlight> Catégorie:Python Catégorie:Scripts »)
 
Aucun résumé des modifications
Ligne 11 : Ligne 11 :
[[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>

Version du 21 janvier 2025 à 14:30

for element in [1, 2, 3]:
  print(element)
  print(element)
compteur = 0
for element in 'Bonjour':
  compteur += 1
  print(element, compteur)