I'm not sure if I need a lambda, or something else. But still, I need the following:
I have an array = [1,2,3,4,5]
. I need to put this array, for instance, into another array. But write it all in one line.
for item in array:
array2.append(item)
I know that this is completely possible to iterate through the items and make it one-line. But googling and reading manuals didn't help me that much... if you can just give me a hint or name this thing so that I could find what that is, I would really appreciate it.
Update: let's say this: array2 = SOME FANCY EXPRESSION THAT IS GOING TO GET ALL THE DATA FROM THE FIRST ONE
(the example is NOT real. I'm just trying to iterate through different chunks of data, but that's the best I could come up with)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…