-
-
Save parzibyte/ce63e3e7bbb35ca842203a91c691eb88 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 texto_a_binario(texto): | |
texto_binario = "" # El resultado | |
contador = 0 | |
for letra in texto: | |
texto_binario += ascii_a_binario(letra) | |
# Agregar un espacio entre binarios, excepto si es el último carácter | |
if contador + 1 < len(texto): | |
texto_binario += separador | |
contador += 1 | |
return texto_binario |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment