What will be the output of the following Python code? [code] l=[] def convert(b): if(b==0): return l dig=b%2 l.append(dig)

What will be the output of the following Python code?
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="")
A. 011
B. 110
C. 3
D. Infinite loop
 

Tìm kiếm

Back
Top