Getting first and last set of elements in Julia - front() and tail() Methods Last Updated : 26 Mar, 2020 Comments Improve Suggest changes Like Article Like Report The front() is an inbuilt function in julia which is used to return a tuple consisting of all but the last component of x, where x is the specified tuple. Syntax: front(x::Tuple)::Tuple Parameters: x::Tuple: Specified tuple. Returns: It returns a tuple consisting of all but the last component of x, where x is the specified tuple. Example: Python # Julia program to illustrate # the use of front() method # Getting a tuple consisting of # all but the last component of x, # where x is the specified tuple. println(Base.front((1, 2, 3))) println(Base.front((2, 4, 6, 8))) println(Base.front((3, 5))) Output: (1, 2) (2, 4, 6) (3, ) The tail() is an inbuilt function in julia which is used to return a tuple consisting of all but the first component of x, where x is the specified tuple. Syntax: tail(x::Tuple)::Tuple Parameters: x::Tuple: Specified tuple. Returns: It returns a tuple consisting of all but the first component of x, where x is the specified tuple. Example: Python # Julia program to illustrate # the use of tail() method # Getting a tuple consisting of # all but the first component of x, # where x is the specified tuple. println(Base.tail((1, 2, 3))) println(Base.tail((2, 4, 6, 8))) println(Base.tail((3, 5))) Output: (2, 3) (4, 6, 8) (5, ) Comment More infoAdvertise with us Next Article Getting first and last set of elements in Julia - front() and tail() Methods K Kanchan_Ray Follow Improve Article Tags : Julia Similar Reads 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 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 Getting exclusive elements of a set in Julia - setdiff() and setdiff!() Methods The setdiff() is an inbuilt function in julia which is used to returns the elements which are in first set but not in second set. Syntax: setdiff(s, itrs...) Parameters:  s: Specified first set.itrs: Specified second set. Returns: It returns the elements which are in first set but not in second s 1 min read Set elements at a given index of array in Julia - setindex!() Method The setindex!() is an inbuilt function in julia which is used to store values from the given array X within some subset of A as specified by inds. Syntax: setindex!(A, X, inds...) Parameters: A: Specified function.X: Specified array.inds: Specified index. Returns: It does not return any values. 1 min read Getting first index of a collection in Julia - firstindex() Methods The firstindex() is an inbuilt function in julia which is used to return the first index of the specified collection. If a dimension d is given, return the first index of collection along dimension d. Syntax: firstindex(collection) or firstindex(collection, d) Parameters: collection: Specified colle 1 min read Like