Skip to content

Instantly share code, notes, and snippets.

@Svastikkka
Created June 12, 2020 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Svastikkka/eef5d915dc1497d4c8be5a9b177d50b9 to your computer and use it in GitHub Desktop.
Save Svastikkka/eef5d915dc1497d4c8be5a9b177d50b9 to your computer and use it in GitHub Desktop.
"""
Alorithm way
"""
def decimalToBinary(num):
if num>1:
decimalToBinary(num//2)
print(num%2,end="")
pass
decimalToBinary(num=int(input()))
"""
In built way
"""
print(bin(12).replace("0b",""))
@Svastikkka
Copy link
Author

Decimal to Binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment