In an assignment I am currently working on we need to work with bit vectors, but I am very unsure of how to do this in Python. They should be able to be from 4 bits to 20 bi
The library BitVector is a pure-Python library for this purpose, and should suit the needs you specified.