PCEP Floating-point literal Practice Question
Which of the following is a valid floating-point literal in Python?
⚠ Common exam trap
A common trap is that candidates may think 1e3 is not a floating-point literal because it lacks a decimal point, but in Python, any numeric literal with an exponent is a floating-point literal. Also, candidates may confuse string or hexadecimal literals with float literals.
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
✓
1e3
Both 1e3 and 3.14 are valid floating-point literals in Python. 1e3 uses scientific notation with an exponent, which Python interprets as a float. 3.14 is a literal with a decimal point. Options B and D are string and integer literals, respectively.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
1e3
Why this is correct
1e3 is a floating-point literal because the 'e' introduces an exponent, making it a float.
- ✗
'3.14'
Why it's wrong here
'3.14' is a string literal, not a number.
- ✓
3.14
Why this is correct
3.14 is a floating-point literal with a decimal point.
- ✗
0xFF
Why it's wrong here
0xFF is an integer literal in hexadecimal notation.
Go deeper
Related to this question
About these practice questions
One of 498 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 →
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.