Post

PythonPython

s
sri kanth

Posted on 28th March 2024|23 views

0
votes

Python Bytes To String

How to convert bytes to string in Python 2.x?

Answers
P
Aryan Sharma

Posted on 28th March 2024

Bytes within Python 2.7 is similar to str. Hence, the variable admitted as bytes is intrinsically a string.

 

Python 2.7.10 (default, Jan 21 2017, 04:15:00) [MSC v.1500 64 bit (AMD64)] on win32

Type "copyright", "credits" or "license()" for more information.

>>> W = x'yz'

>>> W

'yz'

>>> type(W)

<type 'str'>

If you are looking for the Python certification course, you can check out this Python course by Mindmajix.
 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos