strings=['xxaa','xuo','fwefxxx','woeuxxfei'] print(strings) #替换方法1 for string in strings: if 'xx' in string: index=strings.index(string) strings[index]=' print(strings) strings=['xxaa','xuo','fwefxxx','woeuxxfei'] for index,string in enumerate(string…