Python Boolean

Last Updated :
Discuss
Comments

Question 1

What does bool(0) return?

  • A

    True

  • B

    False

  • C

    Error

  • D

    None

Question 2

Which of the following is considered a "truthy" value in Python?

  • A

    0

  • B

    []

  • C

    {}

  • D

    1

Question 3

What is the result of bool(None)?

  • A

    True

  • B

    False

  • C

    None

  • D

    Syntax Error

Question 4

In Python, which operator checks if two variables point to the same object in memory?

  • A

    ==

  • B

    is

  • C

    in

  • D

    !=

Question 5

What is the result of not True?

  • A

    True

  • B

    False

  • C

    None

  • D

    Error

Question 6

How does Python evaluate the expression "bool(0) and bool(1)"?

  • A

    True

  • B

    False

  • C

    Error

  • D

    None

Question 7

Evaluate the result of "False and not False"?

  • A

    True

  • B

    False

  • C

    None

  • D

    Syntax Error

Question 8

Which of the following statements is correct regarding the comparison operators in Python?

  • A

    The `==` operator checks for object identity only.

  • B

    The `!=` operator checks if two values are equivalent.

  • C

    The `==` operator checks for value equality.

  • D

    The `!=` operator checks if two objects are the same.

Question 9

What is the result of the code snippet:

Python
not any([False, False, False])


  • A

    True

  • B

    False

  • C

    Error

  • D

    None

Question 10

What will "all([True, True, False])" return?

  • A

    True

  • B

    False

  • C

    None

  • D

    Syntax Error

There are 10 questions to complete.

Take a part in the ongoing discussion