Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def replace_text(text, replacements):
- for old, new in replacements:
- text = text.replace(old, new)
- # text will be reassigned inside the function
- # the text outside is not modified (call by reference)
- # after all replacements, the changed text is returned by this function
- return text
- replacements = [
- ("Зсбн","3 fM"), ("2сбн", "2 fM"),
- ("3сбн", "3 fM"), ("4сбн", "4 fM"),
- ("6сбн", "6 fM"), ("круг", "Runde"),
- ("ряда", "mal"),
- ]
- text = "Зсбн‚ прибавка, 3сбн‚ (3с6н‚ прибавка)-3раза‚ 3сбн,Зсбн, прибавка-2раза=36сбн"
- print(text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement