+ 2

How do I add a name to all the elements of a list?

Example: Words=[“hi”, “me”, ...] Words_1=[“uphi” , “upme”..]

17th May 2018, 4:09 PM
Andrea Bracci
Andrea Bracci - avatar
3 Respuestas
+ 5
Or: words=["hi", "me", "you"] words = list(map(lambda word: word + "up", words)) print(words)
17th May 2018, 4:37 PM
Paul
Paul - avatar
+ 2
[s + mystring for s in mylist]
17th May 2018, 4:15 PM
Rajeeb
0
Thaks a lot!
17th May 2018, 4:51 PM
Andrea Bracci
Andrea Bracci - avatar