🐸

The Workshop

Python Basicspython-architect-00-workshop
Reward: 50 XP
|

A New Journey: The Workshop

Welcome to The Architect's Path! Hoppy has mastered the basic elemental magic. Now, he stands before the Archmage's Workshop.

Here, magic isn't written on just a single sheet of paper. To build complex spells, the Archmage organizes spells into different Scrolls (Files).

Look above the editor! You see another tab next to main.py. That represents another scroll on the workbench.

Using Multiple Scrolls

In this workshop, main.py is your main workbench. But sometimes, we need tools stored elsewhere.

import tools  # 1. Grab the scroll named 'tools'
tools.hammer() # 2. Use the 'hammer' spell from that scroll

This is called Importing. It keeps our main scroll clean while letting us use powerful external magic!

Your Mission

1
Explore

Click the tools.py tab above the editor to see what spells are hidden inside (just looking, no touching!).

2
Return

Go back to the main.py tab.

3
Cast

Write code to import tools, then use its hammer tools.hammer() to ring the workshop bell!

Interface Change

Notice anything? The "Visualize" button is gone.


In the Workshop, we focus on Creating Results (Terminal), not watching the mana flow. This is the Architect's way.

Suggested Solution
Expand
Solution:
How to wield the hammer:
import tools

print("Getting ready...")
tools.hammer()
Advanced Tips
Want more? Click to expand

F. Bridge to Reality

  • Scrolls are known as Modules in Python.
  • The Workshop is like a Project or Package.
  • In the real world, programmers never write thousands of lines in one file. We split code into different .py files and import them. This is the first step of "Modular Programming"!
Loading...
Terminal
Terminal
Ready to run...