Advertisement
DeaD_EyE

einstein

Feb 2nd, 2022
913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def translator(text):
  2.     translation = str.maketrans(
  3.         {"a": "4", "b": "8", "e": "3", "g": "6", "i": "1", "o": "0", "s": "5", "t": "7"}
  4.     )
  5.     return text.lower().translate(translation).upper()
  6.  
  7.  
  8. msg1 = "The measure of intelligence is the ability to change.".lower()
  9. msg2 = "Albert Einstein".lower()
  10.  
  11. print(translator(msg1))
  12. print(translator(msg2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement