logo

AQA A-Level Computer Science practice

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

Try the question first, then check the answer and practise the same topic again.

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")

Answer and explanation

Concise answer

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

Why this is correct

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

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions