so i want to convert all list decimal to binary contain with 0. but what i make its have int type and the all the 0 is gone.
input = [6, 7, 2, 11, 14, 15, 10, 3, 6, 7, 2, 11, 14, 15, 10, 3]
output = [110, 111, 10, 1011, 1110, 1111, 1010, 11, 110, 111, 10, 1011, 1110, 1111, 1010, 11]
can someone fix my code so it have 0 in the front? like 00000110 its mean 6
here's my code:
def dec_to_bin(x):
print(x)
for a in range(0, len(x)):
keluar = x[a]
biner = int(bin(keluar)[2:])
x[a] = biner
return x