Hey all, I’m trying to work on a simple script that takes a string and replaces each letter in the string. What I’ve tried doing is creating a dictionary for each values such as
mydict = {"a":"1", "b":"2"}
And I've tried some for loops but so far no luck. The idea I have in my head is for each value in the string, replace that value with what I have in the dictionary. But so far no luck.
If all you are doing is replacing one letter with another, simply use
string.maketransandstring.translate.Here’s a pretty simple example of how to use them