DSA Python Recursion Question 5

Last Updated :
Discuss
Comments

What will be the output of the following Python code?

l=[ ]

def convert(b):

    if(b==0):

        return l

    dig=b%2

    l.append(dig)

    convert(b//2)

convert(6)

l.reverse()

for i in l:

    print(i,end="")


 

Infinite loop

011

3

110

Share your thoughts in the comments