I want to fill an array in python with ones in a specific way. An example with 4 digits is the easiest way to explain:
0000, 0001, 0010, 0100, 1000, 1001, 1010, 1100, 1101, 1110, 1111
I need a list with 8 digits, so just writing them down is not an option. I really have no idea how to do that..
Edit: To clarify the problem. I need for the first entry all digits to be 0. Then all possibilities with just one 1, then all possibilities with two 1's and so forth. The last entry would be all 1.