Answers for "how to add a string to each element of a list in python"

0

add a string to each element of a list python

my_list = ['foo', 'fob', 'faz', 'funk']
string = 'bar'
list2 = list(map(lambda orig_string: orig_string + string, my_list))
Posted by: Guest on August-28-2020
3

python add a string to a list

list = ["other str", 2, 56]
list.append("string")
# list = ["other str", 2, 56, "string"]
Posted by: Guest on October-10-2020

Code answers related to "how to add a string to each element of a list in python"

Python Answers by Framework

Browse Popular Code Answers by Language