Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Python expression if x=15 and y=12?
x & y

What will be the output of the following Python expression if x=15 and y=12?
x & y
a) b1101
b) 0b1101
c) 12
d) 1101

Answer: c
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. Hence on performing the bitwise AND operation, we get 1100, which is equal to 12.

Join The Discussion