JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Python interview questions part 3
Python interview questions part 3
Back
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?
A. 7
B. 1
C. 0
D. 5
Show Correct Answer
Correct Answer is :
1
2. Mathematical operations can be performed on a string. State whether true or false.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
FALSE
3. Operators with the same precedence are evaluated in which manner?
A. Left to Right
B. Right to Left
C. Can’t say
D. None of the mentioned
Show Correct Answer
Correct Answer is :
Left to Right
4. What is the output of this expression, 3*1**3?
A. 27
B. 9
C. 3
D. 1
Show Correct Answer
Correct Answer is :
3
5. Which one of the following has the same precedence level?
A. Addition and Subtraction
B. Multiplication, Division and Addition
C. Multiplication, Division, Addition and Subtraction
D. Addition and Multiplication
Show Correct Answer
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.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
7. Which one of the following has the highest precedence in the expression?
A. Exponential
B. Addition
C. Multiplication
D. Parentheses
Show Correct Answer
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.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
FALSE
9. The one’s complement of 110010101 is:
A. 1101010
B. 110010101
C. 1101011
D. 110010100
Show Correct Answer
Correct Answer is :
1101010
10. 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
Show Correct Answer
Correct Answer is :
XOR
11. The result of the expression shown below is: 4^12
A. 2
B. 4
C. 8
D. 12
Show Correct Answer
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.
A. 10
B. 2
C. 1
D. 0
Show Correct Answer
Correct Answer is :
1
13. What is the value of this expression: bin(10-2)+bin(12^4)
A. 0b10000
B. 0b10001000
C. 0b1000b1000
D. 0b10000b1000
Show Correct Answer
Correct Answer is :
0b10000b1000
14. 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
Show Correct Answer
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)
A. 45585
B. 45575
C. 20 10
D. 20 20
Show Correct Answer
Correct Answer is :
20 10
16. What is the two’s complement of -44?
A. 1011011
B. 11010100
C. 11101011
D. 10110011
Show Correct Answer
Correct Answer is :
11010100
17. What is the value of the expression: ~100?
A. 101
B. -101
C. 100
D. -100
Show Correct Answer
Correct Answer is :
-101
18. What is the result of the snippet of code shown below if x=1? x<<2
A. 8
B. 1
C. 2
D. 4
Show Correct Answer
Correct Answer is :
4
19. The output of the expression is: bin(29)
A. ‘0b10111’
B. ‘0b11101’
C. ‘0b11111’
D. ‘0b11011’
Show Correct Answer
Correct Answer is :
‘0b11101’
20. What is the value of x if: x>>2=2
A. 8
B. 4
C. 2
D. 1
Show Correct Answer
Correct Answer is :
8
Similar Interview Questions
Search for latest jobs
Find Jobs