Skip to content

Instantly share code, notes, and snippets.

@amckinley
Created November 20, 2015 20:06
Show Gist options
  • Save amckinley/b9b66024282f2ebec87b to your computer and use it in GitHub Desktop.
Save amckinley/b9b66024282f2ebec87b to your computer and use it in GitHub Desktop.
>>> foo = bytearray(5)
>>> foo[0] = 100
>>> foo[0] = 500
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: byte must be in range(0, 256)
>>> foo[0]
100
>>> chr(foo[0])
'd'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment