nerdexam
Python_Institute

PCEP-30-02 · Question #316

Which one of the lines should you put in the snippet below to match the expected output? Expected output: adam_smit Code: ``python for ch in "[email protected]": if ch == "@": # insert code here…

The correct answer is A. break. See the full explanation below for the reasoning.

Question

Which one of the lines should you put in the snippet below to match the expected output? Expected output: adam_smit Code:
for ch in "[email protected]":
 if ch == "@":
 # insert code here
 print(ch, end="")

Options

  • Abreak
  • Bcontinue
  • Cexit
  • Dprint()

How the community answered

(24 responses)
  • A
    79% (19)
  • B
    4% (1)
  • C
    4% (1)
  • D
    13% (3)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice