list = ['helloXXX', 'welcomeXXX', 'to999', 'SofthuntUUU'] replace = [list.replace('XXX', 'ZZZ') for list in list] print(replace)