fork(1) download
  1. import re
  2.  
  3. m = """
  4. 0 1 2 3 4 5
  5. 1 0 1 2 3 4
  6. 2 1 1 2 3 4
  7. """
  8. repl = 'bip'
  9.  
  10. print (re.sub(r'\n', '\n{} ', m, len(repl)).format(*list(repl)))
Success #stdin #stdout 0.03s 9496KB
stdin
Standard input is empty
stdout
b 0 1 2 3 4 5
i 1 0 1 2 3 4
p 2 1 1 2 3 4