Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python substitute multiple letters

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

PREVIOUS NEXT
Code Example
Python :: python iterate through string in reverse 
Python :: LoginRequiredMixin 
Python :: Change my python working directory 
Python :: number of words in a string python 
Python :: create dictionary from keys and values python 
Python :: ping with python 
Python :: how to make table using python 
Python :: python package version 
Python :: plt.imread python 
Python :: multiprocessing a for loop python 
Python :: day name in python 
Python :: how to url encode using python django 
Python :: fstring 
Python :: python turtle get mouse position 
Python :: pandas max columns 
Python :: how to make a stopwatch in python 
Python :: biggest of 3 numbers in python 
Python :: numpy combinations of 5 bits 
Python :: django admin.py all fields 
Python :: tasks discord py 
Python :: python pdf fpdf example 
Python :: user input of int type in python 
Python :: thread with args python 
Python :: redirect in dajango 
Python :: concat all df in a diction 
Python :: pyplot rectangle over image 
Python :: separate a string in python 
Python :: docker django development and production 
Python :: dataframe KeyError: 
Python :: Converting Hex to RGB value in Python 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =