🐱
ASCII pet
Draw a pet in text — with a mood that changes what you see.
Sprout· ages 8–1015 minmulti-line stringsif / elif / elsevariables
pet.py
…First load pulls ~10 MB of Python. Only happens once — the browser caches it after.
What should the output look like?
A little ASCII face should appear along with the mood label.
📖
How this works
Triple-quoted strings ("""...""") let you draw pictures out of text. if/elif/else lets your code pick between options based on a value — here, which face to show for each mood.
Your turn — try these
- 1Add a new mood — try "hungry" or "angry" — with its own face.
- 2Give the pet a name and print it above the face.
- 3Print "meow" 3 times if the mood is silly.