Hi,
this is my code for converting hex to binary
I converted 6EDAC
# conversion of hex string
# to binary string
import math
# Initialising hex string
ini_string = "6EDAC"
# Printing initial string
print ("Initial string", ini_string)
# Code to convert hex to binary
res = "{0:08b}".format(int(ini_string, 16))
# Print the resultant string
print ("Resultant string", str(res))
so I get 1101110110110101100 in Bin as a result!
from this bin i want to assign a specified value to each and every bits.
and from there i will add all the 1's value in sum and that's what i want to achieve.
is this possible? im stuck here :( help please
this is my code for converting hex to binary
I converted 6EDAC
# conversion of hex string
# to binary string
import math
# Initialising hex string
ini_string = "6EDAC"
# Printing initial string
print ("Initial string", ini_string)
# Code to convert hex to binary
res = "{0:08b}".format(int(ini_string, 16))
# Print the resultant string
print ("Resultant string", str(res))
so I get 1101110110110101100 in Bin as a result!
from this bin i want to assign a specified value to each and every bits.
and from there i will add all the 1's value in sum and that's what i want to achieve.
is this possible? im stuck here :( help please