Run »
txt = "Good night Sam!"; x = "mSa"; y = "eJo"; z = "odnght"; print(txt.maketrans(x, y, z));
{97: 111, 83: 74, 100: None, 103: None, 104: None, 116: None, 109: 101, 110: None, 111: None}