📜  python 替换多个字母 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:17.848000             🧑  作者: Mango

代码示例1
message = "h@ll$ w$rld"
# make the replacement ('!'->'a', '@'->'e', etc.)
message.translate(str.maketrans("!@#$%", "aeiou"))
# outputs hello world