[go: up one dir, main page]

0% found this document useful (0 votes)
24 views4 pages

Python Test 3

interview test 4

Uploaded by

dkhan9935
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views4 pages

Python Test 3

interview test 4

Uploaded by

dkhan9935
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Naresh i Technologies, HYDERABAD

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

Preapred By Subba Raju(Data Scientist)


Naresh i Technologies, HYDERABAD
d) ‘0b1000’
10. What is the result of the expression: 0x35 | 0x75
a) 115
b) 116
c) 117
d) 118
11. It is not possible for the two’s complement value to be equal to the original value in any case.
State whether this statement is true or false.
a) True
b) False
12. The one’s complement of 110010101 is:
a) 001101010
b) 110010101
c) 001101011
d) 110010100
13. Bitwise _________ gives 1 if either of the bits is 1 and 0 when both of the bits are 1.
a) OR
b) AND
c) XOR
d) NOT
14. The result of the expression shown below is: 4^12
a) 2
b) 4
c) 8
d) 12
15. Any odd number on being AND-ed with ________ always gives 1. Hint: Any even number on being
AND-ed with this value always gives 0.
a) 10
b) 2
c) 1
d) 0
16. What is the value of this expression: bin(10-2)+bin(12^4)
a) 0b10000
b) 0b10001000
c) 0b1000b1000
d) 0b10000b1000
17. Which of the following expressions can be used to multiply a given number ‘a’ by 4?
a) a<<2
b) a<<4
c) a>>2
d) a>>4
18. What is the output of the code show below if a=10 and b =20?
a=10
b=20

Preapred By Subba Raju(Data Scientist)


Naresh i Technologies, HYDERABAD
a=a^b
b=a^b
a=a^b
print(a,b)
a) 10 20
b) 10 10
c) 20 10
d) 20 20
19. What is the two’s complement of -44?
a) 1011011
b) 11010100
c) 11101011
d) 10110011
20. What is the value of the expression: ~100?
a) 101
b) -101
c) 100
d) -100
21. What is the output of the code shown below?
l=[1, 0, 2, 0, 'hello', '', []]
list(filter(bool, l))
a) Error
b) [1, 0, 2, 0, ‘hello’, ”, []]
c) [1, 0, 2, ‘hello’, ”, []]
d) [1, 2, ‘hello’]
22. What is the output of the code shown below?
if (9 < 0) and (0 < -9):
print("hello")
elif (9 > 0) or False:
print("good")
else:
print("bad")
a) error b) hello c) good d) bad
23. The output of the line of code shown below is: not(10<20) and not(10>30)
a) True b) False c) Error d) No output
24. The output of the snippet of code shown below?
bool(‘False’)
bool()
a) True True
b) False True
c) False False
d) True False
25. What is the output of the snippet of code shown below?
['hello', 'morning'][bool('')]

Preapred By Subba Raju(Data Scientist)


Naresh i Technologies, HYDERABAD
a) error b) no output c) hello d) morning

Preapred By Subba Raju(Data Scientist)

You might also like