find las element of array python 1

find las element of array python

last_element = an_array[array_length - 1]

Here is what the above code is Doing:
1. We create a variable called array_length and set it equal to the length of the array.
2. We create a variable called first_element and set it equal to the first element of the array.
3. We create a variable called last_element and set it equal to the last element of the array.

Similar Posts