Select items from an array

Publié le: 13 octobre 2022
sur la chaîne: The Python Guide
88
4

Do you want to quickly select every nth element in a Python array? No problem, arrays in Python have built-in 3S property (aka slice notation), where you can specify start, stop and step to filter items in an array. Syntax is pretty simple, array[start:stop:step]. Implicitly if you don’t specify the property, Python will default to the largest unfiltered value and stop value is not included. Default stop value is length of the array, default start value is 0 and default step value is 1. This video shows a few examples on a sample array.


Sur cette page du site, vous pouvez voir la vidéo en ligne Select items from an array durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur The Python Guide 13 octobre 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 88 fois et il a aimé 4 téléspectateurs. Bon visionnage!