Select items from an array

Published: 13 October 2022
on channel: 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.


On this page of the site you can watch the video online Select items from an array with a duration of hours minute second in good quality, which was uploaded by the user The Python Guide 13 October 2022, share the link with friends and acquaintances, this video has already been watched 88 times on youtube and it was liked by 4 viewers. Enjoy your viewing!