Run
# Given string x = "hello world" # Define a mapping table table = {108: 112, 111: 109} # Translate given string x_translated = x.translate(table) print(f"Original : \"{x}\"") print(f"Translated : \"{x_translated}\"")
Output