The __dict__ Attribute Dictionary

Medium State Management (Variables)
Solve in Playground →

Problem Statement

Create a `Book` class setting `title` and `author` in `__init__`. Instantiate a book with input data. Access the object’s `__dict__` dictionary directly to extract and print the title.

Input Format

Two lines containing the title and author.

Output Format

Print 'Dict Title: [title]'.

Constraints

None

Sample Input

Python 101
John Doe

Sample Output

Dict Title: Python 101

Explanation

Under the hood, Python stores instance attributes in a standard dictionary accessible via __dict__.

Starter Code

class Book:
    def __init__(self, title, author):
        self.title = title
        self.author = author

if __name__ == '__main__':
    t = input().strip()
    a = input().strip()
    # Instantiate book and access title via __dict__
    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