MCQ Answer

What will be the output of the following Python code snippet?

bool(False)

bool()

What will be the output of the following Python code snippet?

bool(False)

bool()



निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?

bool(False)

bool()

Topic : Operators Expressions and Python Statements

A. True True

B. False True

C. False False

D. True False




Correct Answer is :

D. True False



Explanation
The Boolean function returns true if the argument passed to the bool function does not amount to zero. In the first example, the string ‘False’ is passed to the function bool. This does not amount to zero and hence the output is true. In the second function, an empty list is passed to the function bool. Hence the output is false.
CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz