Courseiva

PCEP Control Flow, Loops, Lists and Logic Practice Question

Which TWO of the following are true about Python's if statement?

⚠ Common exam trap

The Python Institute often tests the misconception that parentheses are required around the condition in Python, which is a carryover from languages like C or Java, but Python uses indentation and colons instead of parentheses for control flow syntax.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

An if statement can have multiple elif blocks.

Python's if statement allows multiple elif blocks to check additional conditions after the initial if condition. This enables a chain of conditional checks, and each elif is evaluated only if all previous conditions were False. The elif clause is a contraction of 'else if' and is a unique feature of Python's syntax.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    if statements cannot be nested.

    Why it's wrong here

    Nesting is allowed.

  • ✗

    An if statement must have a corresponding else clause.

    Why it's wrong here

    else is optional.

  • ✓

    An if statement can have multiple elif blocks.

    Why this is correct

    Python allows multiple elif clauses.

  • ✓

    The condition can be any expression; e.g., a non-zero integer is considered True.

    Why this is correct

    Any expression is evaluated for truthiness.

  • ✗

    The condition must be enclosed in parentheses.

    Why it's wrong here

    Parentheses are not required.

About these practice questions

Courseiva writes every PCEP question from scratch — 482 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PCEP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCEP exam.