Valid PCEP-30-02 Dumps shared by ExamDiscuss.com for Helping Passing PCEP-30-02 Exam! ExamDiscuss.com now offer the newest PCEP-30-02 exam dumps, the ExamDiscuss.com PCEP-30-02 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com PCEP-30-02 dumps with Test Engine here:
What happens when the user runs the following code?
Correct Answer: D
The code snippet that you have sent is a while loop with an if statement and a print statement inside it. The code is as follows: while True: if counter < 0: print("") else: print("**") The code starts with entering a while loop that repeats indefinitely, because the condition "True" is always true. Inside the loop, the code checks if the value of "counter" is less than 0. If yes, it prints a single asterisk () to the screen. If no, it prints three asterisks (**) to the screen. However, the code does not change the value of "counter" inside the loop, so the same condition is checked over and over again. The loop never ends, and the code enters an infinite loop. The program outputs either one asterisk () or three asterisks (**) to the screen repeatedly, depending on the initial value of "counter". Therefore, the correct answer is D. The program enters an infinite loop. Reference: [Python Institute - Entry-Level Python Programmer Certification]