Created
August 3, 2018 18:16
-
-
Save llimllib/3d46c78d0f8d1c30cadee3cac3cde61a 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 b(integral): | |
res = [] | |
while integral > 0: | |
integral, mod = divmod(integral, 2) | |
res.insert(0, "1" if mod else "0") | |
return "".join(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment