In the recursive function below i want to add the individual bits to a string and return that string to the caller Can anyone tell me how to do that def showbits(x): if x != 1: showbits(x >> 1) if x & 01: print 1, else: print 0,