I know the answer is probably super simple, but I'm absolutely stuck on this short piece of code. The function has no effect on the input list when I run it.
def squareEven(array):
for idx, val in enumerate(array):
if idx % 2 == 0:
val = val * val
else:
val = val
return array
array = [1, 2, 4, 9, 20]
print(squareEven(array))