Valenthtain

Untitled

Jun 22nd, 2021
538
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def repl(data, params):
  2.     for i, j in params.items():
  3.         data = data.replace(i, j)
  4.     return data
  5.        
  6. data = input()
  7. n = int(input())
  8. params= {}
  9.  
  10. for i in range(0,n):
  11.     param = input().split(' ')
  12.     params[param[0]] = param[1]
  13.    
  14. data = repl(data, params)
  15. print(data)
RAW Paste Data