I still need help. I decided to retake this course and ensure that i have a very sound comprehension of every concept and exercise before moving forward.
Kindly see my understanding of the solution to the below code challenge
def double_index(lst, index): if index >= len(lst): return lst else: new_lst = lst[0:index] #the above line assign `index` as one of the indexes of the list, right? new_lst.append(lst[index]*2) #the above line append double `index` new_lst = new_lst + lst[index+1:] #I dont understand the reason why i need to add 1 to the already doubled index. I am sure it wont be added if not necessary but obviously the limitation of my knowledge is not helping here. Please shed more light return new_lst #Uncomment the line below when your function is done print(double_index([3, 8, -10, 12], 2))
Please note, i wont proceed without having a good understanding:slightly_smiling_face: