In this example, you will learn to convert bytes to a string.
To understand this example, you should have the knowledge of the following Python programming topics:
Using decode()
print(b'Easy \xE2\x9C\x85'.decode("utf-8"))
Output
Easy ✅
Using decode(), you can convert bytes into string. Here, we have used utf-8 for decoding. \xE2\x9C\x85 is the utf-8 code for ✅.
Related posts:
Python min()
Python Program to Calculate the Area of a Triangle
Python Functions
Python sleep()
Python 3 for Absolute Beginners - Tim Hall & J.P Stacey
Python Machine Learning Second Edition - Sebastian Raschka & Vahid Mirjalili
Python zip()
Python Package
Python String isnumeric()
Python Program to Find the Factorial of a Number
Machine Learning Mastery with Python - Understand your data, create accurate models and work project...
Python float()
Convert Character Array to String in Java
Machine Learning Applications Using Python - Cases studies form Healthcare, Retail, and Finance - Pu...
Python Program to Convert Decimal to Binary, Octal and Hexadecimal
Python Inheritance
Python timestamp to datetime and vice-versa
Python Operators
Python Objects and Classes
Python Program to Find Armstrong Number in an Interval
Python bool()
Python len()
Building Machine Learning Systems with Python - Willi Richert & Luis Pedro Coelho
Python issubclass()
Python Set discard()
Python Namespace and Scope
Convert String to int or Integer in Java
Learning scikit-learn Machine Learning in Python - Raul Garreta & Guillermo Moncecchi
Python String rsplit()
Python Program to Check if a Number is Positive, Negative or 0
Python Program to Check Whether a String is Palindrome or Not
Python Statement, Indentation and Comments