So far as unobfuscated versions go, how about the simple:
def to_bin(x):
out = []
while x > 0:
out.insert(0, str(x % 2))
x = x / 2
return ''.join(out)Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list
So far as unobfuscated versions go, how about the simple:
def to_bin(x):
out = []
while x > 0:
out.insert(0, str(x % 2))
x = x / 2
return ''.join(out)Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list