Why don’t I need to use an else statement? How is that still bringing the correct list although the index selected is bigger than length?
def double_index(lst, index):
if index < len(lst):
lst[index] = lst[index] * 2
print(double_index([3, 8, -10, 12], 10))
brings [3, 8, -10, 12]