Report Bug

Qus

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="")
Qusनिम्नलिखित Python कोड का आउटपुट क्या होगा?


A. 011
B. 110
C. 3
D. Infinite loop


Solution
B. 110



Explanation
The above code gives the binary equivalent of the number.
Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad