SyntaxFix
Write A Post
Hire A Developer
Questions
I agree with @aaronasterling's answer. However, if you want a non-binary string that you can cast into an int, then you can use the canonical algorithm:
def decToBin(n): if n==0: return '' else: return decToBin(n/2) + str(n%2)