# Binary numbers to list [closed]

I have written the following program in Python:

```s = []
for e in random_key:
s = str(e)
print(s)
```

where the list random_key is

```random_key = ['0011111011100101', '0000010111111011', '0011100110110100',
'1000010101010010', '0011001011001111', '1101101101110011',
'1100001111111011', '0000100000110100', '0101111010100101',
'1001100101100001']
```

The output of the program is

```1111011010110011
1011000110011100
0011011001100010
0000011100100001
1111111010000100
0110110101100011
1011100011000101
1011101011100010
1101101101001010
1000011110110000
```

which is not correct. How can I fix the code?

If I am able to read your thoughts (not sure about that ..). Would you like them to 10 based numbers?

```random_key = ['0011111011100101', '0000010111111011', '0011100110110100',
'1000010101010010', '0011001011001111', '1101101101110011',
'1100001111111011', '0000100000110100', '0101111010100101',
'1001100101100001']

numbers = [int(x, 2) for x in random_key]
print(numbers)
```

output

```[16101, 1531, 14772, 34130, 13007, 56179, 50171, 2100, 24229, 39265]
```