Skip to content

Instantly share code, notes, and snippets.

@llimllib
Created August 3, 2018 18:16
Show Gist options
  • Save llimllib/3d46c78d0f8d1c30cadee3cac3cde61a to your computer and use it in GitHub Desktop.
Save llimllib/3d46c78d0f8d1c30cadee3cac3cde61a to your computer and use it in GitHub Desktop.
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