Get number of elements of array in Julia - length() Method Last Updated : 26 Mar, 2020 Comments Improve Suggest changes Like Article Like Report The length() is an inbuilt function in julia which is used to return the number of elements present in the specified array. Syntax: length(A::AbstractArray) Parameters: A: Specified array Returns: It returns the number of elements present in the specified array. Example 1: Python # Julia program to illustrate # the use of Array length() method # Finding the number of elements present in # the specified 1D array A. A = [5, 10, 15, 20] println(length(A)) # Finding the number of elements present in # the specified 2D array B of size 2 * 2 B = [5 10; 15 20] println(length(B)) # Finding the number of elements present in # the specified 3D array C of size 2 * 2*2 C = cat([1 2; 3 4], [5 6; 7 8], [9 10; 11 12], dims = 3) println(length(C)) Output: Example 2: Python # Julia program to illustrate # the use of Array length() method # Finding the number of elements present in # the specified 1D array A. A = [1, 2, 3]; println(length(A)) # Finding the number of elements present in # the specified 2D array B of size 2 * 2 B = [2 4; 6 8; 10 12]; println(length(B)) # Finding the number of elements present in # the specified 3D array C of size 2 * 2*2 C = cat([1 2; 3 4], [5 6; 7 8], [9 10; 11 12], [13 14; 15 16], dims = 4); println(length(C)) Output: Comment More infoAdvertise with us Next Article Get number of elements of array in Julia - length() Method K Kanchan_Ray Follow Improve Article Tags : Julia Similar Reads Get dimensions of array in Julia - ndims() Method The ndims() is an inbuilt function in julia which is used to return the number of dimension of the specified array A. Syntax: ndims(A::AbstractArray) Parameters: A: Specified array Returns: It returns the number of dimension of the specified array A. Example 1: Python # Julia program to illustrate # 1 min read Getting last element of an array in Julia - last() Method The last() is an inbuilt function in julia which is used to return the last element of the specified iterable collection. Syntax: last(coll) Parameters: coll: Specified iterable collection. Returns: It returns the last element of the specified iterable collection. Example 1: Python # Julia program t 1 min read Counting number of elements in an array in Julia - count() Method The count() is an inbuilt function in julia which is used to count the number of elements in the specified array for which the given predicate p returns true and if p is omitted, counts the number of true elements in the given collection of boolean values. Syntax: count(p, itr) or count(itr) Paramet 2 min read Getting data type of elements in Julia - typeof() Method The typeof() is an inbuilt function in julia which is used to return the concrete type of the specified elements. Syntax: typeof(x) Parameters: x: Specified element. Returns: It returns the concrete type of the specified elements. Example 1: Python # Julia program to illustrate # the use of typeof() 1 min read Getting first element of an array in Julia - first() Method The first() is an inbuilt function in julia which is used to return the first element of the specified iterable collection. Syntax: first(coll) Parameters: coll: Specified iterable collection. Returns: It returns the first element of the specified iterable collection. Example 1: Python # Julia progr 1 min read Like