Question
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’]
Posted under Python
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of the code shown below?
Similar Questions
Discover Related MCQs
Q. Which of the following Boolean expressions is not logically equivalent to the other three?
View solution
Q. Operators with the same precedence are evaluated in which manner?
View solution
Q. What is the output of this expression, 3*1**3?
View solution
Q. Which one of the following have the same precedence?
View solution
Q. The expression Int(x) implies that the variable x is converted to integer. State whether true or false.
View solution
Q. Which one of the following have the highest precedence in the expression?
View solution
Q. Evaluate the expression given below if A= 16 and B = 15.
A % B // A
View solution
Q. Which of the following operators has its associativity from right to left?
View solution
Q. What is the value of x if:
x = int(43.55+2/2)
View solution
Q. What is the value of the following expression?
2+4.00, 2**4.0
View solution
Q. Which of the following is the truncation division operator?
View solution
Q. What is the value of the following expression:
8/4/2, 8/(4/2)
View solution
Q. What is the value of the following expression:
float(22//3+3/3)
View solution
Q. To find the decimal value of 1111, that is 15, we can use the function:
View solution
Q. What is the result of the expression if x=15 and y=12:
x & y
View solution
Q. Which of the following expressions results in an error?
View solution
Q. Which of the following represents the bitwise XOR operator?
View solution
Q. What is the value of this expression?
bin(0x8)
View solution
Q. What is the result of the expression:
0x35 | 0x75
View solution
Q. The one’s complement of 110010101 is:
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Python? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!