« Python : Les iterables » : différence entre les versions

De www.yakakliker.org
(Page créée avec « === Exemple === <syntaxhighlight lang="python3"> liste = [1, 2, 3] iterateur = iter(liste) print(next(iterateur)) # 1 print(next(iterateur)) # 2 print(next(iterateur)) # 3 </syntaxhighlight> Catégorie:Python Catégorie:Scripts »)
 
Aucun résumé des modifications
 
Ligne 13 : Ligne 13 :
[[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>

Dernière version du 21 janvier 2025 à 14:31

Exemple

liste = [1, 2, 3]
iterateur = iter(liste)

print(next(iterateur)) # 1
print(next(iterateur)) # 2
print(next(iterateur)) # 3