Courseiva

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

Which TWO of the following are valid Python data types?

⚠ Common exam trap

Python Institute often tests the distinction between Python's built-in types and types from other languages or modules, so candidates mistakenly choose 'real' (from mathematics) or 'char' (from C/Java) because they assume Python uses the same terminology.

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 B (str) is correct because str is a built-in Python data type used to represent immutable sequences of Unicode characters, such as 'hello'. Option D (int) is correct because int is a built-in Python data type for arbitrary-precision integers, e.g., 42. Option A (real) is not a Python built-in type; Python uses float for floating-point numbers. Option C (array) is not a built-in Python data type, though the array module provides an array class. Option E (char) is not a Python data type; Python represents single characters as strings of length 1.

Answer analysis

Option-by-option breakdown

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

  • ✗

    real

    Why it's wrong here

    'real' is not a Python type name; floating-point values use float, and the numbers module's numbers.Real is an abstract base class, not a built-in. It is tempting because other languages and pseudocode use 'real' for decimals, and float is the valid Python equivalent.

  • ✓

    str

    Why this is correct

    str is a built-in Python data type representing text sequences, such as 'hello'. It satisfies the question's requirement to identify a valid data type, since str is one of Python's core immutable types alongside int, float and bool.

  • ✗

    array

    Why it's wrong here

    'array' is not a built-in Python type; arrays come from the array module or NumPy, while list is the built-in sequence. It is tempting because many languages offer a native array type, and list is the valid Python data type for ordered sequences.

  • ✓

    int

    Why this is correct

    int is a built-in Python data type representing whole numbers of arbitrary precision, such as 42. It satisfies the question's requirement to identify a valid data type, since int is one of Python's core numeric types.

  • ✗

    char

    Why it's wrong here

    Python has no char type; single characters are simply strings of length one, so this fails the question's requirement for a valid data type. It is tempting because languages such as C and Java do provide a distinct char primitive, making it a plausible distractor for candidates transferring knowledge from those languages.

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.