0

I want to know how to convert binary string to just binary numbers. For example, there is a data string as "0xC194" I succeeded to get binary string from string through bin(data) format And after, I want to shift a bit using 'data >> 8' But it shows error that data is string which couldn't shift the bit

How can I convert binary string to just binaries for shifting bits ?

data = "0xC194"
data_b = bin(data)
print(data_b)              // 0b1100000110010100
data_b = data_b >> 8       
print(data_b)              // error
Ash Kim
  • 3
  • 1

0 Answers0