In python 3, by default they(Literal strings) are unicode.
Let's assume text as a bytes object, then use
Since, unicode in python2 is equal to str in python3, you can write the code as:
If you like it.
Looking for python tutorial? Join python training course to gain more knowledge