You need to swap two substrings in passed string.
For example:
if you have a string like "Red is not Blue" and asked to swap "Blue" and "Red", you must return "Blue is not Red"
def swap(string, a, b):
return string.replace(a, '<tmp>').replace(b, a).replace('<tmp>', b)
test.assert_equals(swap('Hello world!', 'Hello', 'world'), 'world Hello!')
test.assert_equals(swap('John greets Eugene', 'John', 'Eugene'), 'Eugene greets John')
test.assert_equals(swap('x = y ^ 2', 'x', 'y ^ 2'), 'y ^ 2 = x')