Ask Your Question

Revision history [back]

sage: length = 10
sage: Bitset(f"{{:0{length}b}}".format(randint(0, 2**length - 1)))
0010101001
sage: Bitset(f"{{:0{length}b}}".format(randint(0, 2**length - 1)))
1100101000