The Double Index code challenge didn’t accept my code and I don’t know why. Below is my code I used:

#Write your function here

def double_index(lst, index):

if index > len(lst):

return lst

else:

lst[index] = 2 * lst[index]

return lst

#Uncomment the line below when your function is done

print(double_index([3, 8, -10, 12], 2))

OUTPUT: [3, 8, -20, 12]

Changed the validation to the following:

print(double_index([3, 8, -10, 12], 5))

The index of 5 is greater than the length of the list which only has 4(0, 1, 2, 3)

OUTPUT: [3, 8, -10, 12]

The outputs matched what was expected for both scenarios.