python - How can I use lambda complete this function? -


i want use lambda finish following function:

for in range(0, len(testinglist)):     testinglist[i] = testing[i][1:-1] 

i don't know how use lambda build it.

thank much.

to make fit in lambda you'd have make 1 expression. list comprehension can that:

somename = lambda tl: [elem[1:-1] elem in tl] 

call testinglist:

testinglist = somename(testinglist) 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -