PYTHON FAQ-2
PYTHON FAQ-2 1 )What is the result of the snippet of code shown below if x=1? x<<2 a) 8 b) 1 c) 2 d) 4 2) The output of the expression is: bin(29) a) ‘0b10111’ b) ‘0b11101’ c) ‘0b11111’ d) ‘0b11011’ 3) What is the value of x if: x>>2=2 a) 8 b) 4 c) 2 d) 1 4.) What is the result of the expression: int(1011)? a) 1011 b) 11 c) 13 c) 1101 5 )To find the decimal value of 1111, that is 15, we can use the function: a) int(1111,10) b) int(‘1111’,10) c) int(1111,2) d) int(‘1111’,2) 6) What is the result of the expression if x=15 and y=12: x & y a) b1101 b) 0b1101 c) 12 d) 1101 7. )Which of the following expressions results in an error? a) int(1011) b) int(‘1011’,23) c) int(1011,2) d) int(‘1011’) 8.) Which of the following represents the bitwise XOR operator? a) & b) ^ c) | d) ! 9.) What is the value of this expression? bin(0x8) a) ‘0bx1000’ b) 8 c) 1000 d) ‘0b1000’ 10.) What is the result of the expression: 0x35 | 0x75 a) 115 b) 116 c) 117 d) 118 11.) It is not possi