How to convert bytes to a string in Python
To convert bytes to a string you need to use the decode()
method by passing character encoding utf-8
OR ascii
as an argument in python.
Here is an example:
print(b"pears".decode("utf-8"))
To convert bytes to a string you need to use the decode()
method by passing character encoding utf-8
OR ascii
as an argument in python.
Here is an example:
print(b"pears".decode("utf-8"))