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 memoryview()
Python Tuple index()
Python ord()
Python String maketrans()
Applied Text Analysis with Python - Benjamin Benfort & Rebecca Bibro & Tony Ojeda
Python Set intersection_update()
Statistical Methods for Machine Learning - Disconver how to Transform data into Knowledge with Pytho...
Python Set symmetric_difference_update()
Python Program to Find the Size (Resolution) of a Image
Python break and continue
Python Operators
Python Program to Check Armstrong Number
Python float()
Python property()
Python Program to Count the Number of Each Vowel
Python Exception Handling Using try, except and finally statement
Python help()
Python Recursion
Python int()
Python Program to Find Numbers Divisible by Another Number
Python __import__()
Python String index()
Python Program to Illustrate Different Set Operations
Python slice()
Python Program to Swap Two Variables
Python len()
Python chr()
Python Machine Learning Third Edition - Sebastian Raschka & Vahid Mirjalili
Python str()
Python Program to Compute all the Permutation of the String
Python Program to Get the File Name From the File Path
Python input()