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 Program to Print the Fibonacci sequence
Python Program to Access Index of a List Using for Loop
Python Program to Find Sum of Natural Numbers Using Recursion
Python String isprintable()
Machine Learning Applications Using Python - Cases studies form Healthcare, Retail, and Finance - Pu...
Python Set isdisjoint()
Python String isnumeric()
Python bytes()
Python Program to Measure the Elapsed Time in Python
Python String upper()
Python Deeper Insights into Machine Learning - Sebastian Raschka & David Julian & John Hearty
Python Program to Display Calendar
Python Program to Iterate Through Two Lists in Parallel
Python strftime()
Python String isidentifier()
Python String rjust()
Python callable()
Python type()
Deep Learning with Applications Using Python - Navin Kumar Manaswi
Python Machine Learning Eqution Reference - Sebastian Raschka
Python ord()
Python List copy()
Python Program to Check Armstrong Number
Python String islower()
Node.js vs Python for Backend Development
Python Program to Delete an Element From a Dictionary
Python Set difference_update()
Python Program to Differentiate Between del, remove, and pop on a List
Python int()
Python Program to Extract Extension From the File Name
Python Program to Print Colored Text to the Terminal
Python String isspace()