Methods: Standard instance behaviors

Easy Method Types & Behaviors
Solve in Playground →

Problem Statement

Create a `Dog` class with an `__init__` method that accepts a `name`. Add an instance method `bark` that prints ‘Dog [name] says: Woof!’. Instantiate a dog and call its `bark` method.

Input Format

A single string representing the dog's name.

Output Format

Print the formatted bark message.

Constraints

Name length <= 50

Sample Input

Rex

Sample Output

Dog Rex says: Woof!

Explanation

Instance methods operate on the specific object's data (state) using the `self` parameter.

Starter Code

class Dog:
    # Define __init__ and bark methods
    pass

if __name__ == '__main__':
    name = input().strip()
    # Instantiate Dog and call bark
    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