In [1]:
s = 'one two one two one'

In [2]:
print(s.replace('one', 'two').replace('two', 'one'))


one one one one one

In [3]:
print(s.replace('one', 'X').replace('two', 'one').replace('X', 'two'))


two one two one two

In [4]:
def swap_str(s_org, s1, s2, temp='*q@w-e~r^'):
    return s_org.replace(s1, temp).replace(s2, s1).replace(temp, s2)

In [5]:
print(swap_str(s, 'one', 'two'))


two one two one two

In [6]:
print(s.replace('o', 't').replace('t', 'o'))


one owo one owo one

In [7]:
print(s.translate(str.maketrans({'o': 't', 't': 'o'})))


tne owt tne owt tne

In [8]:
print(s.translate(str.maketrans('ot', 'to')))


tne owt tne owt tne