logo

Question detail

Which Python code correctly implements this pseudocode? IF score >= 50 THEN OUTPUT "Pass" ELSE OUTPUT "Try again" ENDIF

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Abstraction and automation

Exam-style question

Try this first

Which Python code correctly implements this pseudocode? IF score >= 50 THEN OUTPUT "Pass" ELSE OUTPUT "Try again" ENDIF.

  1. A.if score >= 50: print("Pass") else: print("Try again")
  2. B.if score = 50: print("Pass") else: print("Try again")
  3. C.if score >= 50 print("Pass") else print("Try again")
  4. D.if score >= 50: print("Try again") else: print("Pass")

Model answer

What a good answer should say

  • if score >= 50: print("Pass") else: print("Try again")

Explanation

Why this works

The Python code uses the comparison operator >=, a colon after each condition, indentation for each branch, and outputs the same messages as the pseudocode.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.