Online · Shibuya · Tokyo

Scratch Block Coding Workshops for Children in Shibuya, Tokyo

Scratch block coding workshops for children in Shibuya, Tokyo turn passive screen time into creative coding—arcade games and animated stories built with drag-and-drop logic.

Scratch Shibuya

1. Introduction: From OOP Theory to Practice

In the previous module, we explored the foundations, necessity, and advantages of Object-Oriented Programming (OOP). Now, we examine how to implement OOP directly in Python code: understanding the core concepts of Classes, Objects, Attributes, and Methods, and seeing how objects are constructed and utilized.

Before creating an object in code, you must first define a Class.

2. Class vs. Object: The Blueprint Analogy

Understanding the distinction between a class and an object is fundamental to OOP:

What is a Class?

  • A class is a blueprint, design, or template.
  • The Car Analogy: Before manufacturing an automobile, engineers create an architectural design or blueprint. That blueprint itself is not a physical, drivable car. However, from that single blueprint, a factory can manufacture hundreds or thousands of cars.
  • The House Analogy: Before building a house, an architect creates a blueprint or floor plan. Using that one blueprint, you can build as many houses as you wish.
  • A class defines how much data (attributes) an object will hold and what actions (methods) it can perform.

What is an Object?

  • An object is a real-world instance of a class.
  • While a class is an abstract concept, an object is a concrete, real instance created from that class.

3. Anatomy of a Class: Attributes and Methods

Every class definition packages two core components:

  1. Attributes (Data Elements): The variables defined inside a class that store the data of an object. Example: In a Student class, attributes include name, age, roll_number, and grade. In a Car class, an attribute can be color.
  2. Methods (Behaviors / Actions): The functions defined inside a class that specify the actions an object can perform. Example: In a Student class, methods might include speak(), run(), or study(). In a Car class, a method can be start(). Methods placed inside a class belong specifically to that class and are not global functions.

4. Python Class Syntax: The class Keyword & self

To build a class in Python, use the class keyword followed by the class name (conventionally capitalized):

class Car:
    def __init__(self, color):
        self.color = color

    def start(self):
        print(f"{self.color} car started.")

Understanding the __init__ Method and self

  • The class Car: declaration signals to Python that we are defining a blueprint for car objects.
  • The __init__ method configures and assigns the starting data (such as color) to the newly created car.
  • What is self? self refers to “myself”—the specific object instance being created or operated upon. Whenever a method inside a class is called, its first parameter is always self, representing the object itself. This allows Python to know precisely which object’s attributes are being modified or referenced.
  • self.color = color binds the incoming argument value color to the object’s own internal attribute self.color.
  • The start(self) method is defined using def start(self):. Because it requires no additional external inputs, it accepts only self. When executed, it prints that the car of that specific color has started (e.g., “white car started”).

5. Instantiating Objects and Calling Methods

Once the class template is defined, you can instantiate multiple independent objects from it:

# 1. Creating the first car object named 'my_car' with the color "red"
my_car = Car("red")

# 2. Creating a second car object named 'my_brothers_car' with the color "white"
my_brothers_car = Car("white")

# 3. Calling the start() method on the specific objects
my_car.start()
my_brothers_car.start()

Output:

red car started.
white car started.

Key Rules of Method Invocation

  • Targeting the Object: When invoking my_car.start(), Python executes the start method specifically for my_car, using its stored red color.
  • Templates Cannot Execute Actions Directly: You cannot execute Car.start() directly because a class is merely an abstract blueprint. A blueprint cannot start or drive—only an actual object instance instantiated from that blueprint can perform actions.
  • Each individual object maintains its own independent attributes (e.g., its own unique color) and its own method executions.

6. Why OOP Matters in Modern Software Development

  1. Simplifies Complex Problems: Breaks large, complex software challenges into manageable, self-contained objects.
  2. Improves Teamwork & Code Readability: Code organized into classes and objects is far easier for team members and colleagues to read, understand, and collaborate on.
  3. Reusability and Scalability: Classes can be reused across different programs, and existing classes can easily be extended and scaled as program requirements grow.
  4. Foundation of Modern Languages: OOP is not unique to Python; it forms the core foundation of modern enterprise programming languages, including Java and C++.

Lesson Q&A

A class is an abstract blueprint, template, or design that defines what data attributes and methods an entity will possess. For example, a car's architectural design or a house's floor plan is a blueprint, but not an actual car or house. An object is a real-world, concrete instance created from that class blueprint. From a single Car class blueprint, you can instantiate multiple distinct objects (such as my_car and my_brothers_car), each maintaining its own independent data.

In Python, self refers to the specific instance of the object itself. Whenever a method is defined inside a class, its first parameter is always self. When you call an object's method (e.g., my_car.start()), Python uses self to identify which object is calling the method, allowing the code to access and update that specific object's internal attributes (such as self.color).

Attributes are variables defined inside a class that store an object's data (such as a student's name, age, and grade, or a car's color). Methods are functions defined inside a class that represent the actions or behaviors an object can perform (such as start(), speak(), or run()). A class template cannot execute methods directly because it is merely an abstract definition of data and behaviors. Actions can only be performed by actual object instances created from that class blueprint.

What children can learn

WhatsApp +92 322 421 7059

AI and Robotics Club | The 100 Mission AI & Robotics Hero Journey

Recommended self-paced course for parents & educators

Scratch by MIT Programming for Kids on Udemy.

Disclosure: This page contains affiliate links. We may earn from qualifying purchases at no extra cost to you. Links are intended for parents and educators, not as marketing directed at young children.

From Consumer to Creator: Visual Coding for Shibuya Young Learners

Shibuya’s tech energy motivates creative coding. Scratch emphasises cause and effect. Enquire WhatsApp +92 322 4217059. No invented Shibuya studio.

Frequently asked questions

Does my child need prior programming background to attend the Shibuya Scratch workshop?

No prior experience is required! Our Scratch block coding workshops for children in Shibuya, Tokyo start with basic drag-and-drop visual blocks, allowing young learners to create custom arcade games and animated stories right from lesson one.

Why is block programming effective for children living in fast-paced tech hubs like Shibuya?

Visual block coding removes typing barriers while instilling fundamental computer science concepts like loops, conditional logic, and coordinate physics. As a result, students quickly shift from passive tech consumption to active digital creation.

How do Shibuya families sign up for a free introductory Scratch workshop?

Tap the WhatsApp contact button below to message our mentor desk, review sample student game projects, and secure a free trial pass for your child.

Explore related learning

MinatoRobotics · Minato MeguroPython · Meguro ChibaAnimation · Chiba