hi i am now to the python and i am going through the code challanges on list topic here is the task…

### 4. Double Index

Create a function named `double_index`

that has two parameters: a list named `lst`

and a single number named `index`

.

The function should return a new list where all elements are the same as in `lst`

except for the element at `index`

. The element at `index`

should be double the value of the element at `index`

of the original `lst`

.

If `index`

is not a valid index, the function should return the original list.

For example, the following code should return `[1,2,6,4]`

because the element at index `2`

has been doubled:```

double_index([1, 2, 3, 4], 2)

```
solutiuon
#Write your function here
def double_index(lst, index):
# Checks to see if index is too big
if index >= len(lst):
return lst
else:
# Gets the original list up to index
new_lst = lst[0:index]
# Adds double the value at index to the new list
new_lst.append(lst[index]*2)
# Adds the rest of the original list
new_lst = new_lst + lst[index+1:]
return new_lst
#Uncomment the line below when your function is done
print(double_index([3, 8, -10, 12], 2))
```

my code/solution

```
#Write your function here
def double_index(lst, index):
if index > len(lst):
return lst
else:
lst[index] = lst[index]*2
return lst
#Uncomment the line below when your function is done
print(double_index([3, 8, -10, 12], 2))
```

it was working in all cases and it is mutch simpler but it was not accepted are the any floas in my solution thanks for the help…