python如何将 The quick fox jump over the lazy dog 中的fox,dog对调
s = "The quick fox jump over the lazy dog"
s = s.replace("fox", "$$$$$$$$$replace").replace("dog", "fox").replace("$$$$$$$$$replace", "dog")
print(s)
s = "The quick fox jump over the lazy dog"
s_list = s.split()
# fox 和 dog位置互换
s_list[2], s_list[-1] = s_list[-1], s_list[2]
s = ' '.join(s_list)
print(s)