PixelPup and the Talking TreeGetting Input from the User

After unlocking the Gate of Code using his new function skills, PixelPup stepped into a quiet clearing bathed in golden sunlight. His bag of clues jingled with every step — the feather, the pawprint, the carrot… but he still didn’t know who the thief was.
Suddenly, a deep rumble echoed through the trees.
“Only those who answer may pass.”
“Speak the secret, or turn back!”
Before him stood a towering talking tree — its bark shaped like a face, its branches swaying even though there was no wind.
This wasn’t just another puzzle. This time, PixelPup needed your help.
To go further, he had to ask questions, gather answers, and respond — not just using code, but by talking with it. Could he learn how to take input from his best teammates (you!)?
Get ready — in this episode, we teach PixelPup how to ask questions and listen using Python’s input()
!
- How to ask the user a question using
input()
- How to store user answers in variables
- How to use input in decisions and functions
🐾 PixelPup and the Talking Tree

So, PixelPup just met a Talking Tree that only lets smart coders pass. That means… you need to help him out by typing answers into the program!
Here’s how the magic works:
name = input("What's your name, brave pup? ")
What’s happening here?
We’re asking the person running the program for their name.
Whatever they type gets stored inside a variable called name
.
password = input("What's the secret word? ")
if password == "carrot":
print("✅ Correct! You may pass, " + name + "!")
else:
print("❌ Nope! Come back when you know the secret, " + name + ".")
🎉 What does this do?
Again, whatever they type gets saved in a variable called password
:
This is a magic decision called an if
statement.
- If the password is “carrot”, then PixelPup gets a happy message 🎉
- If it’s not “carrot”, they get a “try again” message 😅
It’s like the tree is saying:
“Only those who know the magic word may pass!”
if ... else:
= Decide what to do based on the answer♣
raw_input()
= Ask a question and wait for an answer💎
name =
or password =
= Save the answerWe are using our re-using the print super power here as well as variables. so lets go pups! So lets try that out here in the python playground below – so type your code and click on the ▶️ button when you are ready to run the command and you will see it showing up on the right side!
🧠 Ask a second question, like:
“What is PixelPup’s favorite treat?”
Then use an if
/else
to check if the user knows it!
Try testing your python code on the above playground and if it works good then Love to hear it – add a comment with your code!
🎨 Bonus Activity – Build your own Maze
Draw what you think the talking tree looks like! Does it have eyes? A smile? Maybe a secret door?
PixelPup loves fan art!! You will be able to see that on our instagram pages too
The Puzzle Game!“PixelPup is almost at the end of the trail! Can he combine everything he learned into his first Python-powered mini game?”
