PCEP 30 02 PCEP Certified Entry Level Python Programmer · Free Practice Question Easy

Question 25

What will be the output of the following code snippet when the user enters 'secret'?

  • A

    Invalid Code - secret

  • B

    ​

  • C
  • D

    valid code - secret

Reveal correct answer

Correct answer: D

Explanation

As, secret == secret will be True, so it prints -

valid code - secret

It encounters the break statement and the loop is terminated.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need