Coding Quiz
In this coding quiz, your task is to write the solution
function that returns the element at a specific index from a given numeric array.
This function takes a numeric array numbers
and an index index
as parameters, then returns the element located at the specified index of the array.
Parameter Format
def solution(numbers, index): # Write your code here return
Constraints
-
numbers
is a list consisting of numbers. -
index
is an integer with a value of 0 or greater, but less than the length of thenumbers
array. -
You must return the element corresponding to the given index.
Example Input/Output
-
Input:
solution([1, 2, 3, 4, 5], 2)
-
Output:
3
Guidelines
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help