Handling Missing Arguments gracefully

Medium Object Lifecycle & Constructors PRO
🔒 Login to Unlock

Problem Statement

Create a `User` class. Its `__init__` should accept `**kwargs`. Check if ’email’ is in `kwargs`. If not, set `self.email` to ‘Not Provided’. Print ‘Email: [email]’.

Input Format

A single string representing an email, or the string 'NONE' to simulate missing.

Output Format

Print the processed email.

Constraints

None

Sample Input

admin@edcret.in

Sample Output

Email: admin@edcret.in

Explanation

Using **kwargs allows flexible object instantiation and requires safe handling of missing keys.

Starter Code

class User:
    # Define __init__ using **kwargs
    pass

if __name__ == '__main__':
    inp = input().strip()
    if inp == 'NONE':
        u = User()
    else:
        u = User(email=inp)

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