Answers for "replace a string in a list"

1

replace a string in a list

list = ['helloXXX', 'welcomeXXX', 'to999', 'SofthuntUUU']
replace = [list.replace('XXX', 'ZZZ') for list in list]
print(replace)
Posted by: Guest on May-05-2022

Code answers related to "replace a string in a list"

Python Answers by Framework

Browse Popular Code Answers by Language