Courseiva

PCEP Practice Question: Data Types, Variables, Basic I/O and Operators

What is the result of bool(0) in Python?

⚠ Common exam trap

Python Institute often tests the misconception that bool(0) returns 0 or None, exploiting candidates who confuse the integer value 0 with the Boolean False, or who think that only the literal False keyword is falsy.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

False

The bool() function in Python converts any value to a Boolean. The integer 0 is considered a falsy value, so bool(0) returns False. This is because Python defines 0, None, empty collections, and False itself as falsy.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    0

    Why it's wrong here

    bool(0) returns the Boolean False, not the integer 0; bool() always yields a bool object, never the original numeric type. Returning 0 is tempting because the input is 0, but the function's purpose is truth-value conversion, so the output type differs from the input.

  • ✗

    None

    Why it's wrong here

    bool(0) returns False, not None; None is a distinct singleton representing absence of value, and bool(None) is also False. None is tempting as a falsy result, but bool() never returns None — it returns one of the two Boolean constants True or False.

  • ✗

    True

    Why it's wrong here

    bool(0) returns False because zero is falsy in Python; True is returned only for non-zero numbers, non-empty containers and other truthy objects. True is tempting because bool() converts values to Boolean type, but the conversion preserves truthiness, not the numeric value itself.

  • ✓

    False

    Why this is correct

    bool() converts any value to a Boolean using Python's truthiness rules. Zero is falsy, so bool(0) returns False. Non-zero numbers, non-empty strings and non-empty containers are truthy, but the integer 0 specifically evaluates to False.

About these practice questions

One of 482 original PCEP practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PCEP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCEP exam.