Sequence of 1's and 0's python bits

Viewed 169

In java, to get a sequence of 1s and 0s in the form of a binary number, you can do the following

(-1 << (4))

while will give me the result

11110000

Since python does not support signed ints, what is the equivalent way of doing this in python? Ideally, I would prefer to do this without any external library.

1 Answers
Related