Created
September 22, 2018 18:13
-
-
Save 9terz/f418b550fc700c9a661ab01c609ccdb3 to your computer and use it in GitHub Desktop.
bingap
This file contains 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 bingap(num): | |
binary = str(bin(num))[2:] | |
print("binary is {}".format(binary)) | |
numlist = binary.split('1') | |
return len(max(numlist, key=len)) | |
print(bingap(6666)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this code failed.