Created
February 2, 2020 20:01
-
-
Save y56/3b4818bb4f10161a1a3f66218b38c69f to your computer and use it in GitHub Desktop.
Convert string to ASCII value python
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
https://stackoverflow.com/questions/8452961/convert-string-to-ascii-value-python | |
>>> s = 'hi' | |
>>> [ord(c) for c in s] | |
[104, 105] | |
>>> s = "hello world" | |
>>> ''.join(str(ord(c)) for c in s) | |
'10410110810811132119111114108100' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment