Advertisement
Nahid8195

I love

Oct 14th, 2021
1,083
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. a_binary_string = "01101001 00100000 01101100 01101111 01110110 01100101 00100000 01111001 01101111 01110101"
  2.  
  3.  
  4. binary_values = a_binary_string.split()
  5.  
  6. ascii_string = ""
  7.  
  8. for binary_value in binary_values:
  9.  
  10.     an_integer = int(binary_value, 2)
  11.  
  12.  
  13.     ascii_character = chr(an_integer)
  14.  
  15.  
  16.     ascii_string += ascii_character
  17. print(ascii_string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement