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