Created
February 6, 2020 22:13
-
-
Save servusdei2018/e7b4485a65e9b3dadba36d38216d84a2 to your computer and use it in GitHub Desktop.
Make English text look Russian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
"Russianize" English text to make it look Russian. | |
Note: This works best when most of the letters are UPPERCASE. | |
''' | |
table = { | |
'R': 'Я', | |
'r': 'Г', | |
'N': 'И', | |
'n': 'П', | |
'A': 'Д', | |
'O': 'Ф', | |
'W': 'Ш', | |
'X': 'Ж', | |
'E': 'Э', | |
'U': 'Ц', | |
'Y': 'Ч' | |
} | |
def main(): | |
while True: | |
russianize(input('Enter text to be Russianized >')) | |
def russianize(s): | |
for entry in table: | |
s = s.replace(entry, table[entry]) | |
print(s) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment