Implementing Enumerations (Enum)

Medium Modern Python OOP Features
Solve in Playground →

Problem Statement

Use the `enum` module to create a `Status` Enum with `PENDING = 1`, `ACTIVE = 2`, and `CLOSED = 3`. Read an integer, instantiate the Enum by value, and print ‘Status: [name]’. Catch a `ValueError` if invalid and print ‘Invalid’.

Input Format

A single integer.

Output Format

Print the enum name or 'Invalid'.

Constraints

None

Sample Input

2

Sample Output

Status: ACTIVE

Explanation

Enums bundle closely related constant states into a readable and strictly validated structure.

Starter Code

from enum import Enum

# Define the Status Enum here

if __name__ == '__main__':
    val = int(input().strip())
    # Evaluate safely and print
    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