Delete Object Instances (del)

Medium Introduction to OOP & Basic Classes
Solve in Playground →

Problem Statement

Define a `TempObject` class. Instantiate it as `obj`. Delete it using the `del` keyword. Then, use a try-except block to print “Object deleted” if accessing `obj` raises a NameError.

Input Format

None

Output Format

Print "Object deleted".

Constraints

None

Sample Output

Object deleted

Explanation

The `del` keyword removes the reference to the object.

Starter Code

class TempObject:
    pass

if __name__ == '__main__':
    obj = TempObject()
    # Delete the object and handle the NameError
    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