fork download
  1. import csv
  2. import sys
  3.  
  4. replacements = list(csv.reader(sys.stdin))
  5.  
  6. your_string = "ten twy fy"
  7. for old, new in replacements:
  8. your_string = your_string.replace(old, new)
  9. print your_string
  10.  
  11.  
Success #stdin #stdout 0.09s 10872KB
stdin
ten,10s
twy,20s
fy,40s
stdout
10s 20s 40s