Skip to code

Chapter 2 · The story continues down here

Shh. There’s something
we can light up.

You’ve looked beneath the surface. Now try changing something — and see how the nightlight answers.

CHESS

your first nightlight0 %
HUSH

PROJECTnightlight.pyroute.pycastle.py SCENEnightlightlight ACTIONS
nightlight.pyroute.py

# how much light shall we give the moon?

lamp = Nightlight("Quiet light")

lamp.on()

darkbright

WHY2MAKE · Python syntaxUTF-8

A name for the nightlight

What shall we call your moon?

Saved only in this browser on this device.

Check it together

A light for a bedtime story

Make a nightlight that glows softly: brightness from 1 to 30. Run the command and show a grown-up which number you chose.

Right now your nightlight is at 0 %