Property Deleters

Medium Encapsulation & Data Hiding
Solve in Playground →

Problem Statement

Add a `@temperature.deleter` to the `Weather` class that prints ‘Data cleared’ and sets `__temp` to None. Invoke it using `del w.temperature`.

Input Format

None

Output Format

Print 'Data cleared'.

Constraints

None

Sample Output

Data cleared

Explanation

Property deleters provide a hook to clean up memory or reset states when the `del` keyword is used on a property.

Starter Code

class Weather:
    def __init__(self):
        self.__temp = 25
    
    @property
    def temperature(self):
        return self.__temp
    
    # Add @temperature.deleter

if __name__ == '__main__':
    w = Weather()
    # Delete the property
    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