PCEP Practice Question: Data Types, Variables, Basic I/O and Operators
Exhibit
Refer to the exhibit. Output of command: python3 -c "print(type(3.14))" <class 'float'>
A developer runs the command and sees the output. Which statement about the data type is correct?
⚠ Common exam trap
The PCEP exam often tests the misconception that Python has separate 'float' and 'double' types, similar to languages like C or Java, when in fact Python's float is always double-precision and there is no distinct double type.
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
✓
3.14 is a float in Python.
In Python, numeric literals with a decimal point, such as 3.14, are always interpreted as the built-in float type. Python does not have a separate 'double' type; its float is implemented as a C double (64-bit IEEE 754), but the language itself refers to it as float. This is a fundamental rule of Python's data type system.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
3.14 is a decimal.Decimal type.
Why it's wrong here
Not unless explicitly converted.
- ✗
3.14 is a float, but Python also treats it as a double.
Why it's wrong here
Python's float is double precision, but the type is simply called float.
- ✓
3.14 is a float in Python.
Why this is correct
Correct; the type is float.
- ✗
3.14 is a string.
Why it's wrong here
It is a numeric literal.
Go deeper
Related to this question
About these practice questions
This PCEP question is part of Courseiva's 498-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
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.