By Kevin McAleer, 3 Minutes
Page last updated November 20, 2026

Time to write some code. You don’t need a board for this lesson, because Snakie has one built in.
When Snakie opens, it connects to the Simulated device (offline). This is real MicroPython, running inside Snakie instead of on a chip. You can see it in the status bar at the bottom left, and in the device list above the console.
It behaves like a real board: it runs your programs, it has pins you can switch on and off, and it even has its own little filesystem. The one difference is that it forgets everything when you disconnect.
untitled-1.py opens.print("Hello from Snakie!")
Look at the Console at the bottom. Your message appears after the >>> prompt.

print() shows whatever you put between the brackets. Text goes inside quote marks; that’s called a string.
You can run the same program in this page. Press Run, then change the message and run it again.
Robots repeat things, so let’s count. Replace your code with this:
Here’s what each line does:
import time brings in MicroPython’s timing toolsfor count in range(5, 0, -1): repeats the indented lines with count set to 5, 4, 3, 2, then 1time.sleep(1) waits one secondWhile a program is running, the red button says Stop. Press it to end the program early. On the simulator, stopping also restarts the simulated board, and the console says so.
In the desktop app you can press Ctrl+R to run (⌘+R on a Mac).
range().Problem: SyntaxError: invalid syntax
Solution: Check that every ( has a ), every " has a partner, and the for line ends with a colon.
Why: Python needs these to know where things start and end.
Problem: IndentationError
Solution: The lines inside the loop must all start with the same four spaces.
Why: Indentation is how Python knows which lines belong to the loop.
Quick quiz 1 of 2
Where does the output of print() appear in Snakie?
Quick quiz 2 of 2
What is the Simulated device?
You can use the arrows ← → on your keyboard to navigate between lessons.
Comments