Question
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
Posted under Python
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of the following code?
Similar Questions
Discover Related MCQs
Q. Which of these is false about recursion?
View solution
Q. ______________ returns a dictionary of the module namespace.
________________ returns a dictionary of the current namespace
View solution
Q. What happens if a local variable exists with the same name as the global variable you want to access?
View solution
Q. The nested list undergoes shallow copy even when the list as a whole undergoes deep copy. State whether this statement is true or false.
View solution
Q. In _______________ copy, the base address of the objects are copied.
In _______________ copy, the base address of the objects are not copied.
View solution
Q. Which of these is not true about recursion?
View solution
Q. Only problems that are recursively defined can be solved using recursion. True or False?
View solution
Q. Which is the most appropriate definition for recursion?
View solution
Q. On assigning a value to a variable inside a function, it automatically becomes a global variable. State whether true or false.
View solution
Q. Which of the following data structures is returned by the functions globals() and locals()?
View solution
Q. Where are the arguments received from the command line stored?
View solution
Q. How are required arguments specified in the function heading?
View solution
Q. How are default arguments specified in the function heading?
View solution
Q. What is the value stored in sys.argv[0]?
View solution
Q. What is the type of sys.argv?
View solution
Q. Which module in the python standard library parses options received from the command line?
View solution
Q. How are variable length arguments specified in the function heading?
View solution
Q. How many keyword arguments can be passed to a function in a single function call?
View solution
Q. How are keyword arguments specified in the function heading?
View solution
Q. What is the length of sys.argv?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Python? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!