Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def dictTrans(string, dict):
- for i in dict:
- string = string.replace(i, dict[i])
- return string
- test = "hello, world!"
- tab = {"hello": "goodbye"}
- print dictTrans(test, tab)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement