fork download
  1. word = 'helloxworld'
  2. char_to_replace = 'x'
  3. print(word.replace(char_to_replace, ' '))
  4.  
  5. word = 'helloxworld'
  6. char_to_replace = 'x'
  7. print(word.replace(char_to_replace, ' ' + char_to_replace))
  8.  
Success #stdin #stdout 0.1s 10104KB
stdin
Standard input is empty
stdout
hello world
hello xworld