Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 10, 2018 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/087b099eaedf09ed6136b7ffb339b072 to your computer and use it in GitHub Desktop.
Save parzibyte/087b099eaedf09ed6136b7ffb339b072 to your computer and use it in GitHub Desktop.
LetrasAAscii created by parzibyte - https://repl.it/@parzibyte/LetrasAAscii
"""
Letras a código ASCII
@author parzibyte
"""
cadena = "Soy un mensaje"
codificado = []
for letra in cadena:
codificado.append(ord(letra))
print("El mensaje '{}' se convierte en {}".format(cadena, codificado))
# El mensaje 'Soy un mensaje' se convierte en [83, 111, 121, 32, 117, 110, 32, 109, 101, 110, 115, 97, 106, 101]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment