COMPUTER SCIENCE AND ENGINEERING
MACHINE LEARNING
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
[1, 2, 3, 4, 5]
|
|
[2, 3, 4, 5]
|
|
[1, 3, 4, 5]
|
|
[1, 2, 3, 4]
|
Detailed explanation-1: -Explanation: The output of the following Python code will be no output, because the while loop will not execute at all. The value of num is “0", which is not in the list lis, so the loop condition will evaluate to False and the loop will not execute.
Detailed explanation-2: -What is the output of print (2**3**5) ** represents the exponent. By law of exponents, (x^a)^b=x^(a×b) So here, the answer will be, 2^15=32768 In case of python, it calculates the 2nd part first, which gives, 2^(243). Use of brackets plays a key role.
Detailed explanation-3: -25 is the output. list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] is a list that consists 1 to 10 numbers within it.
Detailed explanation-4: -i = 0whilei < 5:print(i)i += 1ifi == 3:breakelse:print(0)a) 0 1 2 0b) 0 1 2c) errord) none of the mentionedView AnswerAnswer: bExplanation: The else part is not executed if control breaks out of the loop. Explanation: NameError, i is not defined.