Python interview questions part 3

Python interview questions part 3

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

1. What is the answer to this expression, 22 % 3 is?

Correct Answer is : 1

2. Mathematical operations can be performed on a string. State whether true or false.

Correct Answer is : FALSE

3. Operators with the same precedence are evaluated in which manner?

Correct Answer is : Left to Right

4. What is the output of this expression, 3*1**3?

Correct Answer is : 3

5. Which one of the following has the same precedence level?

Correct Answer is : Addition and Subtraction

6. The expression Int(x) implies that the variable x is converted to integer. State whether true or false.

Correct Answer is : TRUE

7. Which one of the following has the highest precedence in the expression?

Correct Answer is : Parentheses

8. 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.

Correct Answer is : FALSE

9. The one’s complement of 110010101 is:

Correct Answer is : 1101010

10. Bitwise _________ gives 1 if either of the bits is 1 and 0 when both of the bits are 1.

Correct Answer is : XOR

11. The result of the expression shown below is: 4^12

Correct Answer is : 8

12. 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.

Correct Answer is : 1

13. What is the value of this expression: bin(10-2)+bin(12^4)

Correct Answer is : 0b10000b1000

14. Which of the following expressions can be used to multiply a given number ‘a’ by 4?

Correct Answer is : a<<2

15. What is the output of the code show below if a=10 and b =20? a=10 b=20 a=a^b b=a^b a=a^b print(a,b)

Correct Answer is : 20 10

16. What is the two’s complement of -44?

Correct Answer is : 11010100

17. What is the value of the expression: ~100?

Correct Answer is : -101

18. What is the result of the snippet of code shown below if x=1? x<<2

Correct Answer is : 4

19. The output of the expression is: bin(29)

Correct Answer is : ‘0b11101’

20. What is the value of x if: x>>2=2

Correct Answer is : 8

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon