Question 1 of 25
Hints left: 3
Q1
What will be the output of the following Python expression? 4^12
Q2
What will be the value of the following Python expression? bin(10-2)+bin(12^4)
Q3
What will be the output of the following Python code? ['f', 't'][bool('spam')]
Q4
What will be the output of the following Python code? l=[1, 0, 2, 0, 'hello', '', []] list(filter(bool, l))
-
A
-
B
-
C
-
D
Q5
What is the result of `True | False` ?
Q6
What will be the output of the following Python code if the system date is 21st June, 2017 (Wednesday)? [] or {} {} or []
Q7
What is the result of True & False ?
Q8
What will be the output of the following Python code if a=10 and b =20? a=10 b=20 a=a^b b=a^b a=a^b print(a,b)
Q9
What is the result of `(8 >> 2) | (1 << 2)` ?
Q10
What will be the output of the following Python code snippet? ['hello', 'morning'][bool('')]
Q11
What will be the output of the following Python code snippet? bool(‘False’) bool()
Q12
What is the result of not True ?
Q13
What is the result of ~5 ?
Q14
Which of the following expressions results in an error?
Q15
What is the result of `(4 | 2) & 6` ?
Q16
What will be the output of the following Python expression? 0x35 | 0x75
Q17
What will be the output of the following Python code? if (9 < 0) and (0 < -9): print("hello") elif (9 > 0) or False: print("good") else: print("bad")
Q18
What is the value of the following Python expression? bin(0x8)
Q19
What is the result of 12 ^ (7 << 1) ?
Q20
What is the result of 7 ^ 7 ?
Q21
What will be the output of the following Python code snippet if x=1? x<<2
Q22
What is the result of (10 >> 1) & 3 ?
Q23
What is the result of `5 << 1 | 2 >> 1` ?
Q24
Which of the following expressions can be used to multiply a given number 'a' by 4?
Q25
Which of the following Boolean expressions is not logically equivalent to the other three?