QuizAnswer
Home
Contact
Say hello -
quizanswers.mail@gmail.com
1. What will be the output of the following Python code if the system date is 21st June, 2017 (Wednesday)?
[] or {}
{} or []
Answer.
{}
[]
2. What will be the value of the following Python expression?
bin(10-2)+bin(12^4)
Answer.
0b10000b1000
3. 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.
Answer.
1
4. What will be the output of the following Python code?
l=[1, 0, 2, 0, 'hello', '', []]
list(filter(bool, l))
Answer.
[1, 2, 'hello']
5. What will be the output of the following Python expression if x=15 and y=12?
x & y
Answer.
12
6. What will be the value of the following Python expression?
float(4+int(2.39)%2)
Answer.
4.0
7. Which among the following list of operators has the highest precedence?
+, -, **, %, /, <<, >>, |
Answer.
**
8. To find the decimal value of 1111, that is 15, we can use the function:
Answer.
int('1111',2)
9. What is the value of the following expression?
2+4.00, 2**4.0
Answer.
(6.0, 16.0)
10. What will be the value of x in the following Python expression?
x = int(43.55+2/2)
Answer.
44
Prev
Next