Overriding Class Variables

Easy Advanced Inheritance & MRO
Solve in Playground →

Problem Statement

Create a base class `Config` with a class variable `timeout = 30`. Create a derived class `FastConfig` that overrides `timeout` to 10. Print `Config.timeout` on line 1, and `FastConfig.timeout` on line 2.

Input Format

None

Output Format

Print the respective timeouts.

Constraints

None

Sample Output

Config: 30
FastConfig: 10

Explanation

Derived classes can override class variables. This shadows the base class variable for instances of the derived class, while leaving the base class variable intact.

Starter Code

class Config:
    timeout = 30

class FastConfig(Config):
    # Override timeout here
    pass

if __name__ == '__main__':
    # Print the timeouts formatted properly
    pass

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used