Skip to content

Instantly share code, notes, and snippets.

@hash3liZer
Created July 29, 2020 20:27
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 hash3liZer/ebdacd05cbf39ece7ea826062c304a21 to your computer and use it in GitHub Desktop.
Save hash3liZer/ebdacd05cbf39ece7ea826062c304a21 to your computer and use it in GitHub Desktop.
Python 3 Bytes Vs Strings
# String Encoding to Bytes
aa = "a value here"
aa = aa.encode('utf-8')
# Bytes Conversion to String
bb = b"these are bytes"
bb = bb.decode('utf-8')
print(type(aa))
print(type(bb))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment