1

I read the following sentence in book "introducing python"

Python 3 strings are Unicode strings, not byte arrays. This is the single largest change from Python 2, which distinguished between normal byte strings and Unicode character strings.

I am very confused here, I tested respectively in python3 and python2

in python 3

In [12]: s = "python3"
In [13]: type(s)
Out[13]: str

In python2:

>>> s = "python2"
>>> type(s)
<type 'str'>

They are of the identical type.

How could I find the description "byte arrays" in "python2"?

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.