MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
names = “{1}, {2} and {0}".format(’John’, ‘Bill’, ‘Sean’)print(names)
A
John, Bill, Sean
B
Bill, Sean, John
C
Bill, John, Sean
D
John, Sean, Bill
Explanation: 

Detailed explanation-1: -What will be the output of the following Python function? Explanation: The function max() is being used to find the maximum value from among-3, -4 and false. Since false amounts to the value zero, hence we are left with min(0, 2, 7) Hence the output is 0 (false).

Detailed explanation-2: -7. What is the result of cmp(3, 1)? Explanation: cmp(x, y) returns 1 if x > y, 0 if x == y and-1 if x < y. 8.

Detailed explanation-3: -Which of the following is true for variable names in Python? a) unlimited length b) all private members must have leading and trailing underscores c) underscore and ampersand are the only two special characters allowed d) none of the mentioned Answer: a Explanation: Variable names can be of any length.

There is 1 question to complete.