Courseiva

PCAP Object-Oriented Programming Practice Question

A subclass overrides a method but wants to call the parent class's version. Which keyword should be used?

⚠ Common exam trap

Python Institute often tests the distinction between `super()` and `self`, where candidates mistakenly think `self` can access the parent's overridden method, but `self` always refers to the current instance and will call the subclass's version if overridden.

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

✓

super()

In Python, the `super()` function is used to call a method from the parent class. When a subclass overrides a method, `super().method_name()` allows the subclass to invoke the parent class's implementation, enabling cooperative multiple inheritance and proper method resolution order (MRO). This is the correct keyword for accessing the parent class's version of an overridden method.

Answer analysis

Option-by-option breakdown

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

  • ✗

    base

    Why it's wrong here

    The identifier 'base' is not a Python keyword, so writing 'base.method()' would raise a NameError. While 'base' is often used by convention to name a superclass (e.g., class Base), the language provides no built-in alias to refer to a parent type. You must either hardcode the parent class name or use super() to access inherited methods.

  • ✓

    super()

    Why this is correct

    super() is the correct mechanism because it returns a proxy object that forwards method calls to the next class in the method resolution order (MRO). This allows the subclass's overridden method to invoke the parent implementation without naming the parent class explicitly, which remains correct even under multiple inheritance. A typical usage is super().method_name(args), though in Python 3 you can also call it without arguments inside a class method.

  • ✗

    parent

    Why it's wrong here

    Unlike some other object-oriented languages (e.g., PHP's parent keyword), Python has no built-in 'parent' identifier. Using 'parent' would be interpreted as a variable name and cause a NameError unless you had accidentally defined such a variable. Python instead requires you to rely on the class's MRO via super() or to reference the parent class directly by its registered name.

  • ✗

    self

    Why it's wrong here

    The 'self' parameter always refers to the current instance, not to the parent class. Calling self.method() inside the subclass's override merely re-invokes the subclass's own method, leading to infinite recursion and eventually a RecursionError. To reach the parent implementation, you must bypass the current class using super().method(), which explicitly traverses the MRO beyond the current class.

About these practice questions

Courseiva writes every PCAP question from scratch — 421 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 PCAP 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 PCAP exam.