diff --git a/strings.html b/strings.html index 247d711..afaa490 100644 --- a/strings.html +++ b/strings.html @@ -265,7 +265,7 @@ experience of years.
>>> by = b'abcd\x65' ① >>> by -b'abcde' +b'abcde' >>> type(by) ② <class 'bytes'> >>> len(by) ③ @@ -279,7 +279,7 @@ b'abcde' 97 >>> by[0] = 102 ⑦ Traceback (most recent call last): - File "<stdin>", line 1, in+ File "<stdin>", line 1, in <module> TypeError: 'bytes' object does not support item assignment
bytes object, use the b'' “byte literal” syntax. Each byte within the byte literal can be an ASCII character or an encoded hexadecimal number from \x00 to \xff (0–255).