I have following code:
myList = [1,2,3,4,5]
result = []
test = [result.append(i) for i in myList]
Whose output of test
is:
[None, None, None, None, None]
I would like to know why, since for example:
test = [print(i) for i in myList]
Print each one successfully
I do not want the solution to this, I know in a normal for loop this results, I would just like to know why append
is not executed as I want