COMPUTER SCIENCE AND ENGINEERING
ALGORITHMS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
True
|
|
False
|
|
Either A or B
|
|
None of the above
|
Detailed explanation-1: -What will be the output of the following Python expression if x=15 and y=12? Explanation: The symbol ‘&’ represents bitwise AND. This gives 1 if both the bits are equal to 1, else it gives 0. The binary form of 15 is 1111 and that of 12 is 1100.
Detailed explanation-2: -6. What will be the value of the following Python expression? Explanation: The output of bin(10-2) = 0b1000 and that of bin(12^4) is ob1000. Hence the output of the above expression is: 0b10000b1000.
Detailed explanation-3: -Expert-Verified Answer The code will definitely return a Boolean value(True or False). For the expression to be True, the two statements must be True. The AND gate returns True if the whole statement is True. (10 >= 5*2) is True because 10 is equals to 5 × 2 = 10.