-1

I am using BitVector in Python. I have to perform division over two bit vectors.

I have used the code below:

from BitVector import*
mod = BitVector( bitstring='1011011' )
n = 6
a = BitVector( intVal = 9223372036854775809 )
quotient, remainder = a.gf_divide(mod, n)
print(quotient)
print(remainder)

The output that I am getting is the following:

0000001011111100101010001100111101110101101001101100010010000111

0000

I want to convert quotient into a list. I can not use the command list{quotient} as quotient is not a string. print(type(quotient)) gives the output <class 'BitVector.BitVector.BitVector'>.

How can I convert quotient in to a list ?

  • Although [this](https://stackoverflow.com/questions/39460882/how-to-get-execution-of-python-print-statements-as-a-string) directly answers your question, it's likely not what you want. – user202729 May 27 '18 at 13:00

1 Answers1

0

What about list(str(quotinent))?

Uku Loskit
  • 40,868
  • 9
  • 92
  • 93