| 1 | initial version |
You can also use Bitset.
sage: B = Bitset('0110101')
sage: C = Bitset('0' * B.capacity())
sage: for i in range(B.capacity()):
....: C.add(i)
....: print(B.symmetric_difference(C))
....: C.discard(i)
1110101
0010101
0100101
0111101
0110001
0110111
0110100
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.