Recursion

Abhijit Soman abhijit_som at yahoo.co.in
Fri Jul 19 01:55:53 EDT 2002


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,




More information about the Python-list mailing list