Modifying each element in a list in a function


#1

Please provide the solution for the same.


#2

Hi @salla123,

Your return statement is included in the for loop, therefore only the first iteration of the loop is performed.

The function parameter is x. In all statements within the double_list function, including the loop header, the list should be referred to as x rather than as n.

Remove one level of indentation from this line to move it to outside the loop ...

        return x

#3

it worked thanks for your action


#4