Created
December 2, 2019 22:40
-
-
Save xen/7eca70d34ca9ea965ecc32f491493d81 to your computer and use it in GitHub Desktop.
Morse code
This file contains hidden or 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
codes = { | |
"А": ".-", | |
"Б": "-...", | |
"В": ".--", | |
"Г": "--.", | |
"Д": "-..", | |
"Е": ".", | |
"Ж": "...-", | |
"З": "--..", | |
"И": "..", | |
"Й": ".---", | |
"К": "-.-", | |
"Л": ".-..", | |
"М": "--", | |
"Н": "-.", | |
"О": "---", | |
"П": ".--.", | |
"Р": ".-.", | |
"С": "...", | |
"Т": "-", | |
"У": "..-", | |
"Ф": "..-.", | |
"Х": "....", | |
"Ц": "-.-.", | |
"Ч": "---.", | |
"Ш": "----", | |
"Щ": "--.-", | |
"Ъ": "--.--", | |
"Ы": "-.--", | |
"Ь": "-..-", | |
"Э": "..-..", | |
"Ю": "..--", | |
"Я": ".-.-", | |
"1": ".----", | |
"2": "..---", | |
"3": "...--", | |
"4": "....-", | |
"5": ".....", | |
"6": "-....", | |
"7": "--...", | |
"8": "---..", | |
"9": "----.", | |
"0": "-----", | |
".": "......", | |
",": ".-.-.-", | |
":": "---...", | |
";": "-.-.-.", | |
"(": "-.--.-", | |
")": "-.--.-", | |
"'": ".----.", | |
'"': ".-..-.", | |
"-": "-....-", | |
"/": "-..-.", | |
"?": "..--..", | |
"!": "--..--", | |
"@": ".--.-.", | |
"=": "-...-", | |
" ": " ", | |
} | |
print("Перевод текста в азбуку Морзе") | |
text = input("Введите текст кирилицей: ") | |
converted = " ".join([codes[i] for i in text.upper()]) | |
print(f"Ваш текст азбукой Морзе будет {converted}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment