Courseiva

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

Which THREE of the following are Python data types?

⚠ Common exam trap

The PCEP exam often tests the distinction between a data type and a module or a value, so candidates may mistakenly select `math` (a module) or `None` (a value) as data types because they appear frequently in Python code.

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

✓

str

Option A, str, is correct because str is Python's built-in immutable text/string type, used for sequences of Unicode characters. Option C, bool, is correct because bool is a built-in subclass of int representing the two truth values True and False. Option D, float, is correct because float is Python's built-in floating-point type, typically implemented as a C double for real numbers. Option B, math, is not a data type but a standard-library module that provides mathematical functions. Option E, None, is not a data type but the singleton object None, whose type is NoneType.

Answer analysis

Option-by-option breakdown

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

  • ✓

    str

    Why this is correct

    `str` is a built-in Python data type representing immutable sequences of Unicode characters, satisfying the stem's requirement for a genuine data type. It is a core text type created via literals or `str()`, distinct from containers like `list` and `dict`, and is recognised by `isinstance("x", str)`.

  • ✗

    math

    Why it's wrong here

    math is a standard-library module, not a built-in data type, so it cannot appear in a list of Python types. It is tempting because modules are objects and appear in type-related contexts, and the name suggests numeric types such as int or float that the question is actually asking for.

  • ✓

    bool

    Why this is correct

    Boolean values represent truth states and are a built-in Python data type, satisfying the stem's requirement to identify genuine types. Unlike containers such as lists or tuples, `bool` is a primitive scalar type with exactly two instances, `True` and `False`, and it subclasses `int`. This confirms it as one of the three correct selections.

  • ✓

    float

    Why this is correct

    A float represents real numbers with fractional parts, stored as IEEE 754 double-precision values in CPython. It is a built-in numeric type, satisfying the stem's requirement to identify Python data types. Unlike containers such as lists or strings, float is a scalar numeric primitive, making it unambiguously one of the three correct selections.

  • ✗

    None

    Why it's wrong here

    None is a singleton value of the NoneType, not itself a data type name, so it does not belong in a list of Python types. It is tempting because NoneType is a genuine type and None is frequently discussed alongside types, making the value look interchangeable with the type.

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.