Introduction to Unicode

Let's learn how strings can be unicode.

One of the major changes in Python 3 was the move to make all strings Unicode. Previously, there was a str type and a unicode type. For example:

Press + to interact
# Python 2
x = 'blah'
print (type(x))
y = u'blah'
print (type(y))

If we do the same thing in Python 3, you will note that it always returns a string type:

Press + to interact
# Python 3
x = 'blah'
print (type(x))
y = u'blah'
print (type(y) )

Testing unicode variable name in Python 2

Testing unicode

...
Access this course and 1400+ top-rated courses and projects.