Jan-17-2024, 09:13 PM
(This post was last modified: Jan-17-2024, 09:13 PM by Gribouillis.)
(Jan-17-2024, 08:54 PM)new_coder_231013 Wrote: Does it have something to do with the base system of the input and / or output - such as the particular base system the method assumes the input is expressed in? Or the base system it uses for the output? What am I missing here?The key thing to understand about the bytes type in Python is that while Python prints
b'Hello world'
, the bytes object is actually an array of small integers>>> list(b'Hello world') [72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100] >>> a = b'Hello world' >>> a[0] 72 >>> a[1] 101The printed version uses Ascii encoding for printable characters.
« We can solve any problem by introducing an extra level of indirection »