Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Complete the get_index_of_smallest function which is passed a list of integer nu

ID: 3755094 • Letter: C

Question

Complete the get_index_of_smallest function which is passed a list of integer numbers as a parameter. The function returns the index of the smallest element in the list. If two or more numbers in the list have the same value as the smallest number, the function should return the first number from the start of the list which has the smallest value The function should return -1 if the list is an empty list. For example Test Result list1 [23, 3, 6, 5, 12, 9, 7, 4 1 print(get_index_of_smallest(list1)) [23, 3, 6, 5, 12, 9, 7, 4] print(list1) Answer (penalty regime: 0 %) 1 Idef get_index_of_smallest (numbers): Check

Explanation / Answer

def get_index_of_smallest(numbers): if len(numbers) == 0: return -1 else: ind = 0 for i in range(len(numbers)): if numbers[i]
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote