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 value of x in the following Python expression, if the result of that expression is 2?
x>>2

What will be the value of x in the following Python expression, if the result of that expression is 2?
x>>2
a) 8
b) 4
c) 2
d) 1

Answer: a
Explanation: When the value of x is equal to 8 (1000), then x>>2 (bitwise right shift) yields the value 0010, which is equal to 2. Hence the value of x is 8.

Join The Discussion