I believe I found a solution?

I am completely lost on this due mostly to not understanding that index values can be set through a variable. Being that I have been unable to solve this myself, I copied the cheater results and examined them line for line (though I’ll try again without help tomorrow):

1 #Write your function here
3 # Define function ‘double_index’ and it’s variables ‘lst’ and ‘index’
4 def double_index(lst, index):
6 # Check to see that variable ‘index’ is equal to or greater than the number of entries in the variable ‘lst’ (defined as a list in the final print statement, but from now on referred to as ‘list’ instead of ‘variable’), and if so, return the list ‘lst’ as is
7 if index >= len(lst):
8 return lst
10 # In case the variable ‘index’ is lower than the number of entries in list ‘lst’, execute the following commands
11 else:
13 # Create a new variable that takes it’s value from list ‘lst’ from the first entry up to, but not including the entry taking it’s value from variable ‘index’
14 new_lst = lst[0:index]
16 # Multiply the entry specified in variable ‘index’ by 2 and append to list ‘new_list’
17 new_lst.append(lst[index]*2)
19 # Redifine ‘new_list’ as previously stated ‘new_list’ appended with list ‘lst’ from the entry specified in variable ‘index’ to the final entry and return the results
20 new_lst = new_lst + lst[index+1:]
21 return new_lst
23 #Uncomment the line below when your function is done
25 # Define as list and define entries for variable ‘lst’ and define value of variable ‘index’ for function ‘double_index’ and print the results of function ‘double_index’
26 print(double_index([3, 8, -10, 12], 2))

Sorry if the structure in my comments is strange, but I understand it (I think).

Tried it a day later without referring to the solution, and also doing things a different way. After a bit of research, I found what seems to me to be a simpler way than the official solution (copied the old list to a new list, doubled the integer and replaced the integer with the new value), and it does the passes:

#Write your function here
def double_index(lst, index):
if index >= len(lst):
return lst
new_index = lst[index] * 2
new_lst = lst
new_lst[index] = new_index
return new_lst

#Uncomment the line below when your function is done
print(double_index([3, 8, -10, 12], 2))