FC0-U71 Applications and Software Practice Question
A developer is writing a script in Python that processes user input. The script needs to execute a block of code repeatedly while a condition is true. Which programming construct should the developer use?
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
✓
while loop
A while loop repeats a block of code as long as a condition is true.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
for loop
Why it's wrong here
A for loop iterates over a sequence, not necessarily while a condition is true.
- ✓
while loop
Why this is correct
A while loop repeats while a condition is true.
- ✗
function
Why it's wrong here
A function is a reusable block of code, not a loop.
- ✗
if/else
Why it's wrong here
if/else is for conditional branching, not repetition.
Go deeper
Related to this question
About these practice questions
One of 988 original FC0-U71 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 FC0-U71 practice question is part of Courseiva's free CompTIA 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 FC0-U71 exam.