I am new to Python and am having a really really hard time with this. I am not able to understand what exactly I have to do and why my code isn’t working.
Create a function named
double_index that has two parameters named
The function should double the value of the element at
lst and return the new list with the doubled value.
index is not a valid index, the function should return the original list.
After writing your function, un-comment the call to the function that we’ve provided for you to test your results.
def double_index (lst, index):
if index >= len(lst):
double = lst[index] *2
I am new to coding in general, so please I would love some help on this. I’ve been stuck for a really long time on this.