Open this example in the interactive library
Source code
value = 255
print(value.bit_length(), (value + 1).bit_length())Sample output
8 9

Open this example in the interactive library
value = 255
print(value.bit_length(), (value + 1).bit_length())8 9