This function returns the last item in an array.
def last_item(arr): return arr[-1]
Whether it's the first item or the last, indexing an array is a constant time operation .
This workbook was created by Jad and Rayan Slim. Feel free to explore some of their courses:
The Complete Java Development Bootcamp
The Complete Spring Boot Development Bootcamp – Become a Java Web Developer
There are no written reviews yet.