MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is the output of the following?True = Falsewhile True:print(True)
A
True
B
False
C
Infinite Loop
D
Error
Explanation: 

Detailed explanation-1: -Explanation: The line of code can be translated to state that ‘f’ is printed if the argument passed to the Boolean function amount to zero. Else ‘t’ is printed. The argument given to the Boolean function in the above case is ‘spam’, which does not amount to zero. Hence the output is t.

Detailed explanation-2: -What will be the output of the following Python expression? Explanation: The binary form of the number 29 is 11101. Hence the output of this expression is ‘0b11101’. Take Python Programming Tests Now!

Detailed explanation-3: -3. Which of the following Python statements will result in the output: 6? Explanation: The output that is required is 6, that is, row 2, item 3. This position is represented by the statement: A[1][2].

Detailed explanation-4: -The code shown above returns a new list containing only those elements of the list l which do not amount to zero. Hence the output is: [1, 2, ‘hello’].

There is 1 question to complete.