Created
May 15, 2020 09:56
-
-
Save AlphaHot/54c3c8536bae84cb978586eda6bde6b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cntBit(num): | |
return len(bin(num)) - 2 | |
print(cntBit(0xFFFFFFFF)) # 32 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment