-
-
Save parzibyte/63375f6f0d5eef18c3522944777e26ad to your computer and use it in GitHub Desktop.
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
def morse_a_caracter_plano(morse): | |
for caracter in equivalencias: | |
if equivalencias[caracter] == morse: | |
return caracter | |
# Si no encontramos equivalencia, regresamos una cadena vacía | |
return "" | |
def decodificar_morse(morse): | |
texto_plano = "" # Aquí alojamos el resultado | |
for caracter_morse in morse.split(" "): | |
# Por cada carácter, buscamos su equivalencia | |
caracter_plano = morse_a_caracter_plano(caracter_morse) | |
# Lo concatenamos al resultado. | |
texto_plano += caracter_plano | |
return texto_plano |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment