3
x = "01100001"

How do i convert this string into ASCII

Expected Result:

print(x.somefunction())
Output: a
TechDinoKing
  • 51
  • 1
  • 8
  • 3
    Did you googled for it? There's already a perfectly good answer on top of my google search: http://stackoverflow.com/questions/7396849/convert-binary-to-ascii-and-vice-versa – fedepad Jan 25 '17 at 10:32

1 Answers1

4

Use following one liner

x = chr(int('010101010',2))

will work.

Jay Parikh
  • 2,419
  • 17
  • 13