s = 'one two one two one' # 1st argument: string to find # 2nd argument: string to put in place print(s.replace(' ', '-')) # one-two-one-two-one