Python Python Array Length


The Length of an Array

Use the len() method to return the length of an array (the number of elements in an array).

Example

Return the number of elements in the cars array:

x = len(cars)
Try it Yourself »

Note: The length of an array is always one more than the highest array index.



Copyright 1999-2023 by Refsnes Data. All Rights Reserved.