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 set()
Python Set isdisjoint()
Python issubclass()
Python Program to Catch Multiple Exceptions in One Line
Python Type Conversion and Type Casting
Python Program to Delete an Element From a Dictionary
Python Program to Find the Factorial of a Number
Python Program to Represent enum
Python List copy()
Python Program to Check Armstrong Number
Python Program to Create Pyramid Patterns
Python Program to Find HCF or GCD
Machine Learning Mastery with Python - Understand your data, create accurate models and work project...
Python Program to Create a Long Multiline String
Python strptime()
Learning scikit-learn Machine Learning in Python - Raul Garreta & Guillermo Moncecchi
Python Matrices and NumPy Arrays
Python String isnumeric()
Python String casefold()
Deep Learning with Python - A Hands-on Introduction - Nikhil Ketkar
Python Program to Convert Kilometers to Miles
Python Program to Find ASCII Value of Character
Python Program to Print Output Without a Newline
Python pow()
Python Program to Multiply Two Matrices
Python Program to Randomly Select an Element From the List
Python for Programmers with introductory AI case studies - Paul Deitel & Harvey Deitel
Python Tuple index()
Java Program to Convert a Decimal Number to Binary Number using Stacks
Python Program to Add Two Numbers
Python Decorators
Python Program to Sort a Dictionary by Value