python if index not out of range code example
Example: python if index not out of range
def double_index(lst, index):
try:
lst[index] = lst[index] * 2
except IndexError:
return lst
def double_index(lst, index):
try:
lst[index] = lst[index] * 2
except IndexError:
return lst