project_python.3.2/lesson.11.py

40 lines
986 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

''' ****** Задание 11 из 20 *********
*
'''
if __name__ == "__main__":
TRANSLITERATION_MAP = {
'А': 'A', 'Б': 'B', 'В': 'V',
'Г': 'G', 'Д': 'D', 'Е': 'E',
'Ё': 'E', 'Ж': 'ZH', 'З': 'Z',
'И': 'I', 'Й': 'I', 'К': 'K',
'Л': 'L', 'М': 'M', 'Н': 'N',
'О': 'O', 'П': 'P', 'Р': 'R',
'С': 'S', 'Т': 'T', 'У': 'U',
'Ф': 'F', 'Х': 'KH', 'Ц': 'TC',
'Ч': 'CH', 'Ш': 'SH', 'Щ': 'SHCH',
'Ы': 'Y', 'Э': 'E', 'Ю': 'IU',
'Я': 'IA', 'Ь': '', 'Ъ': '',
}
input_text = input()
for char in input_text:
upper_char = char.upper()
if upper_char in TRANSLITERATION_MAP:
transliterated = TRANSLITERATION_MAP[upper_char]
if char.isupper():
print(transliterated.capitalize(), end='')
else:
print(transliterated.lower(), end='')
else:
print(char, end='')