binary to text python
a_binary_string = "01100001 01100010 01100011"
ascii_string = "".join([chr(int(binary, 2)) for binary in a_binary_string.split(" ")])
# ascii_string = "abc"
binary to text python
a_binary_string = "01100001 01100010 01100011"
ascii_string = "".join([chr(int(binary, 2)) for binary in a_binary_string.split(" ")])
# ascii_string = "abc"
text to binary python
a_string = "abc"
a_byte_array = bytearray(a_string, "utf8")
byte_list = []
for byte in a_byte_array:
binary_representation = bin(byte)
byte_list.append(binary_representation)
print(byte_list)
#Output ['0b1100001', '0b1100010', '0b1100011']
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us