Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

WGU Foundations of Programming (Python) (E010) Exam - Topic 2 Question 1 Discussion

Posted by Shanice on May 07, 2026 at 08:30 AM

A program uses this while loop to count down:

count = 5

while count > 0:

print(count)

Which issue is preventing the loop from working correctly?

Suggested Answer: B

The loop condition is:

while count > 0:

At the start, count is 5, so the condition is true. The program prints the value of count.

However, inside the loop, the value of count is never changed. That means count always stays 5, so the condition count > 0 is always true. As a result, the loop runs forever.

A corrected version would be:

count = 5

while count > 0:

print(count)

count = count - 1

This decreases count by 1 during each loop iteration. Eventually, count becomes 0, and the condition count > 0 becomes false.

Therefore, the correct answer isB. It runs infinitely because count is never modified.


Get Premium Foundations of Programming (Python) (E010) Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
24 comments · newest first
EL
Ellsworth 2 days ago
C could be a problem too, but it's not the main one.
KI
Kip 7 days ago
But the loop won't stop without modifying count. B is the main issue.
CA
Carrol 12 days ago
I feel like A is also a problem. Missing colon can cause issues.
ED
Edgar 17 days ago
Agreed, it runs infinitely.
JU
Julieta 23 days ago
I think it's B. Count never changes.
JA
Jamika 28 days ago
D doesn't matter much; the name is fine.
AN
Annice 1 month ago
Definitely B. Without modifying count, it won't stop.
DO
Dorthy 1 month ago
C could be an issue, but it still counts down to 1.
LA
Lavonda 1 month ago
I feel like A is a problem too, but not the main one.
YU
Yuki 2 months ago
Agreed, it runs infinitely.
XU
Xuan 2 months ago
I think it's B. Count never changes.
EL
Elfrieda 2 months ago
D doesn't make sense, the name is fine.
JA
Jacqueline 2 months ago
A colon is fine, so not A.
TR
Tresa 2 months ago
Wait, could it be C instead?
AD
Adelina 2 months ago
Agreed, it will run forever!
VE
Veta 3 months ago
It's definitely B, count isn't changing.
NA
Nadine 3 months ago
I don't think the variable name matters much, but I guess it could be a reason if it was used elsewhere.
BE
Ben 3 months ago
I feel like the condition should be using >= instead of >, but I'm not entirely confident about that.
GW
Gwenn 3 months ago
I'm not sure, but I remember something about needing a colon after the while condition. Could that be the issue?
DE
Delisa 3 months ago
I think the loop might run infinitely because count isn't being modified inside the loop. That sounds familiar from practice questions.
AL
Aleshia 4 months ago
I don't think the variable name is the issue here, but I could be wrong. It seems like a minor detail compared to the loop logic.
LI
Lili 5 months ago
I feel like I've seen a question like this before, and it was about the condition needing to be >= instead of just >.
LI
Lisandra 5 months ago
I'm not entirely sure, but I remember something about needing a colon after the while condition. Could that be it?
MY
Myra 5 months ago
I think the loop might run infinitely because count is never modified inside the loop. That seems like a common mistake.
0/2000 characters

Save Cancel