def update_array(incoming: tuple, output: list = []):
for index, element in enumerate(incoming):
output[index] = incoming[index]
if index % 2 == 0:
incoming[index] = incoming[index] / 2
return output
In the above example, line 3 is giving out of index error
output[index] = incoming[index]
IndexError: list assignment index out of range
i couldn't understand why the error occurring, trying to learn tuple and list. Thank you:-)