Online guidance · Azabu · Tokyo

STEAM Miniature Model Building and Prototyping in Azabu, Tokyo

A STEAM miniature model building and prototyping workshop for Azabu introduces safe maker materials—foam board, gears, LEDs and small motors—so children learn spatial design before or alongside coding.

STEAM Azabu

1. Introduction: Implementing OOP in Python

In previous modules, we examined the theoretical concepts, benefits, and foundations of Object-Oriented Programming (OOP). In this topic, we transition from theoretical concepts to practical implementation in Python using Jupyter Notebook by creating and practicing with our first custom Class and Object.

Before generating any physical instance or object, Python requires the creation of a Class blueprint.

2. Step 1: Building a Minimal Class Template

To define a new class, use the class keyword, followed by the class name, and terminate the header with a colon (:). Indented underneath with a tab or four spaces, define its first method using the def keyword:

# 1. Defining the Car class blueprint
class Car:
    def drive(self):
        print("The car is moving")

How Python Interprets the Blueprint

  • The class keyword informs Python that a new class template is being defined.
  • Car names the template.
  • def drive(self): declares a method named drive inside the class.
  • The self parameter serves as the object reference, allowing Python to know which specific object instance called the method.
  • The method body contains an executable statement, print("The car is moving").

When you execute this code cell in Jupyter Notebook, no output is displayed. This occurs because you have only constructed the blueprint or design. An architectural design cannot drive on the road; output and actions only occur once an actual object is instantiated from the template.

3. Step 2: Instantiating an Object and Calling Methods

To create a real object based on the Car template, assign the class constructor call to a variable:

# 1. Creating the first car object instance
car1 = Car()

# 2. Calling the drive method on car1
car1.drive()

Execution Walkthrough

  • Writing car1 = Car() instructs Python to construct an object named car1 using the Car template.
  • As a result, all data attributes and methods defined inside Car become available inside car1.
  • Calling car1.drive() uses parentheses to invoke the method.

Why We Do Not Manually Pass self

Notice that when calling car1.drive(), no argument is placed inside the parentheses. self is an automatic input parameter. When you write car1.drive(), Python automatically passes the calling object (car1) into the self parameter behind the scenes. Therefore, you do not pass self manually.

Output:

The car is moving

4. Step 3: Adding Data Attributes to the Class

A complete object contains both functions (methods) and variables (data attributes). We can expand the Car class by adding a data attribute named color with a default value of "red", and updating the drive method to reference that attribute:

class Car:
    # Adding a data attribute with a default value
    color = "red"

    def drive(self):
        print(f"{self.color} car is moving")

Testing the Updated Blueprint

car1 = Car()
car1.drive()

Output:

red car is moving
  • By accessing self.color, the drive method prints the specific color associated with that object.
  • If the car's color is red, it outputs "red car is moving"; if green, it outputs "green car is moving".

5. Step 4: Modifying Attributes with Setter Methods

In Object-Oriented Programming, objects contain data attributes and methods designed to operate on or modify those attributes. To change the default color of a car, we can add a method called set_color:

class Car:
    color = "red"

    def drive(self):
        print(f"{self.color} car is moving")

    # Setter method to update the car's color
    def set_color(self, new_color):
        self.color = new_color

Understanding the Setter Method

  • The set_color method accepts self (passed automatically) along with a second parameter: new_color.
  • Inside the method body, self.color = new_color reassigns the object's color attribute to the new value.
  • Methods dedicated to updating or assigning values to attributes are commonly called setters.

6. Step 5: Instantiating Multiple Independent Objects

One of the core strengths of OOP is that you can instantiate as many independent objects as needed from a single class template, each maintaining its own distinct attributes:

# 1. Instantiate a second, distinct car object
car2 = Car()

# 2. Modify the color of car2 using our setter method
car2.set_color("green")

# 3. Call the drive method on car2
car2.drive()

Output:

green car is moving

Key Takeaways

  • Calling car2.set_color("green") updates the internal color of car2 to "green".
  • When car2.drive() executes, it prints "green car is moving" instead of "red car is moving".
  • The template remains reusable and scalable: developers can add more attributes and methods, building up complexity while creating distinct objects with unique data states.

Lesson Q&A

Executing a class definition produces no screen output because a class is merely an abstract blueprint or template, not a concrete object. Defining the class simply teaches Python what attributes and methods that type of entity will have. Actions and output occur only after you instantiate an actual object from that class (such as car1 = Car()) and explicitly call its methods.

In Python, self is an automatic input parameter. When you call an object's method using dot notation—such as car1.drive()—Python automatically passes the calling object (car1) into the self parameter behind the scenes. This allows the method to know precisely which object instance called it and access that specific object's attributes without requiring you to pass it explicitly in code.

A setter method (such as set_color(self, new_color)) is a method defined inside a class specifically to update or assign a new value to an object's data attribute. By passing a new value into the setter (e.g., car2.set_color("green")), the method reassigns the internal attribute (self.color = new_color). When other methods like drive() are subsequently called, they reflect the updated attribute value.

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

Robotics Miniature Modeling 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.

Hands and Minds: Physical Models That Teach Engineering Intuition

Azabu families seeking maker skills benefit from craft that trains spatial reasoning. Adult supervision required for tools and motors. Enquire WhatsApp +92 322 4217059. No invented Azabu venue or kit prices.

Frequently asked questions

What materials are used in the Azabu STEAM miniature model building workshop?

Students construct physical models using safe, accessible maker components—including foam board chassis, thermocol structures, gear assemblies, LEDs, and DC motors—to build functional mini-robots, bridges, and smart houses.

How does physical craftwork and prototyping enhance digital robotics learning?

Physical model building develops 3D spatial reasoning, mechanical intuition, and fine motor skills. When paired with electronic sensors, students gain a complete end-to-end understanding of hardware engineering.

How do families in Azabu register for a free introductory STEAM prototyping class?

Contact our admissions mentor via WhatsApp to select an open weekend session and download our beginner STEAM project blueprint.

Explore related learning

MinatoRobotics · Minato ShinjukuArduino · Shinjuku YokohamamBlock · Yokohama