New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Python Institute PCEP-30-02 Exam - Topic 1 Question 11 Discussion

Actual exam question for Python Institute's PCEP-30-02 exam
Question #: 11
Topic #: 1
[All PCEP-30-02 Questions]

What is the expected output of the following code?

Show Suggested Answer Hide Answer
Suggested Answer: C

The code snippet that you have sent is a loop that checks if a variable ''floor'' is less than or equal to 0 and prints a string accordingly. The code is as follows:

floor = 5 while floor > 0: print(''+'') floor = floor - 1

The code starts with assigning the value 5 to the variable ''floor''. Then, it enters a while loop that repeats as long as the condition ''floor > 0'' is true. Inside the loop, the code prints a ''+'' symbol to the screen, and then subtracts 1 from the value of ''floor''. The loop ends when ''floor'' becomes 0 or negative, and the code exits.

The code outputs five ''+'' symbols to the screen, one for each iteration of the loop. Therefore, the correct answer is C. five.


Contribute your Thoughts:

0/2000 characters
Glory
3 months ago
I thought it would show more stars!
upvoted 0 times
...
An
3 months ago
Wait, it produces no output? Really?
upvoted 0 times
...
Jannette
4 months ago
Nah, I don't think that's right.
upvoted 0 times
...
Elza
4 months ago
Definitely going with option B!
upvoted 0 times
...
Earleen
4 months ago
I think it outputs * * *
upvoted 0 times
...
Alonso
4 months ago
I’m leaning towards option D, but I’m worried I might be misremembering the loop structure from my notes.
upvoted 0 times
...
Clement
4 months ago
I feel like the answer could be B or C, but I keep mixing up how many asterisks were printed in those practice questions.
upvoted 0 times
...
Giovanna
5 months ago
I remember a similar question where the output was just asterisks, but I can't recall if it was one or multiple.
upvoted 0 times
...
Vanda
5 months ago
I think the code might produce no output, but I'm not entirely sure. It looks familiar.
upvoted 0 times
...
Honey
5 months ago
This seems like a tricky one, but I'm going to give it my best shot. I'll carefully consider each output option and try to match it to the code.
upvoted 0 times
...
Maira
5 months ago
I'm a little confused by the nested loops in the code. I'll need to walk through it slowly to make sure I understand what's happening.
upvoted 0 times
...
Howard
5 months ago
Okay, I think I've got this. The code is printing a single asterisk, so the correct answer must be option D.
upvoted 0 times
...
Dierdre
5 months ago
Hmm, I'm a bit unsure about this one. I'll need to think it through step-by-step to figure out what the code is doing and which output option is correct.
upvoted 0 times
...
Louvenia
5 months ago
This looks like a pretty straightforward question. I'll carefully read through the code and the options to determine the expected output.
upvoted 0 times
...
Danica
5 months ago
Okay, let me see. The question is asking about a service for managing cloud computing resources, including deployment. Based on that, I'm leaning towards Option C, Resource Orchestration Service (ROS). It sounds like the right fit, but I'll double-check the other options just to be sure.
upvoted 0 times
...
Arthur
5 months ago
I remember we discussed how 802.1X primarily deals with device authentication on the network, but I can't quite recall how it relates to encryption or protecting video feeds.
upvoted 0 times
...
Keena
5 months ago
I've got this! The key is setting up the Make sourcing rule and marking the item as Assemble-To-Order.
upvoted 0 times
...
Sunshine
5 months ago
I'm a bit confused on this one. I know RESTCONF uses TLS, but I'm not sure about the specifics of how it's implemented. I'll have to review my materials and try to eliminate the incorrect options.
upvoted 0 times
...
Audria
9 months ago
I bet the person who wrote this question is a real loop-de-loop kind of programmer. Hopefully, the answer isn't just a bunch of asterisks spinning in a circle!
upvoted 0 times
...
Portia
9 months ago
I wonder if the image is just a red herring to distract us. Maybe the code will print out 'Surprise, it's a trick question!' or something equally bizarre.
upvoted 0 times
Gearldine
8 months ago
B) * * *
upvoted 0 times
...
Valentin
8 months ago
I think the image is just there to confuse us.
upvoted 0 times
...
Nu
8 months ago
A) The code produces no output.
upvoted 0 times
...
...
Michael
9 months ago
Oh, I know this one! The output is going to be B) * * *. Easy peasy!
upvoted 0 times
...
Aimee
9 months ago
Hmm, I'm not sure about this one. I'll have to carefully trace the code step-by-step to figure it out.
upvoted 0 times
Ronna
8 months ago
User 4: Let's carefully analyze the code to find the expected output
upvoted 0 times
...
Paola
8 months ago
User 3: I'm not sure, maybe we should trace the code step-by-step
upvoted 0 times
...
Fausto
9 months ago
User 2: No, I believe it is C) * *
upvoted 0 times
...
Kate
9 months ago
User 1: I think the answer is B) * * *
upvoted 0 times
...
...
Elfrieda
10 months ago
This is a classic nested loop question. I think the output will be B) * * *.
upvoted 0 times
Rosita
8 months ago
The expected output should be B) * * *.
upvoted 0 times
...
Gilma
9 months ago
I believe it will output B) * * *.
upvoted 0 times
...
Zona
9 months ago
I think the answer is B) * * *.
upvoted 0 times
...
...
Alisha
11 months ago
But if you look at the code closely, it only prints one star at a time, so I still think it's B) * * *
upvoted 0 times
...
Tamesha
11 months ago
I disagree, I believe the output is C) * *
upvoted 0 times
...
Alisha
11 months ago
I think the expected output is B) * * *
upvoted 0 times
...

Save Cancel