๐Ÿ

Python Adventure

Your Quest to Master the Art of Coding!

For Brave Beginners  โ€ข  Ages 10โ€“12  โ€ข  4 Chapters of Magic

โฌ‡  Scroll to begin your quest  โฌ‡

โฌ‡ Download All Python Scripts (.zip)
CH 1

The Text Spells โœจ

Learning: print() and Strings

๐Ÿช„
โญโ˜†โ˜†โ˜†โ˜† First Steps โฑ 20 min โœจ You'll make: A welcome message that prints YOUR name and battle cry

๐Ÿ“– The Story

You've just arrived at the Python Wizard Academy! To prove you're worthy of the title Apprentice Coder, you must master your first spell โ€” the legendary Text Spell. With it, you can make any words appear on any screen in the kingdom. No magic wand requiredโ€ฆ just a keyboard! ๐Ÿง™

๐Ÿ’ก The Big Idea

In Python, print() is your megaphone. Any message you put inside the brackets will appear on the screen. Words inside quote marks ("like this") are called Strings โ€” they're the magical text scrolls of Python!

print("Hello, World!") โ†’ Hello, World!   print("I cast a spell!") โ†’ I cast a spell!

๐Ÿ–ฅ๏ธ Do This in PyCharm

  1. 1
    Open PyCharm and go to File โ†’ Openโ€ฆ. Navigate to the kids-python-adventure folder and click OK / Trust Project.
  2. 2
    In the left panel (Project Explorer), double-click chapter_1_magic_words.py to open it in the editor.
  3. 3
    Read the green comment lines at the top โ€” they're your quest briefing! Every line that starts with # is a comment (Python ignores it; it's written for you).
  4. 4
    Find the lines marked # TODO. These are your challenges! Change the text inside the quotes to your own name and answers. Keep the " " marks exactly where they are!
  5. 5
    Click the big green โ–ถ Play button in the top-right corner (or press Shift + F10). Watch the magic happen in the Console below!

๐Ÿ‘€ What to Look For in PyCharm

At the bottom of your screen, a dark panel pops open โ€” that's the Run Console. It's like the display screen of your computer game. Look for:

  • โœ… Your own name printed on a line by itself
  • โœ… Your favorite animal and battle cry
  • โœ… A big decorative banner made of โœจ symbols
  • โœ… The message "CHAPTER 1 COMPLETE!"

๐ŸŽ‰ If you see your name in the Console โ€” you cast your FIRST Python spell!

๐Ÿ† After This Chapter You'll Know:

print() Strings " " Comments # Running Code โ–ถ
CH 2

Memory Boxes ๐Ÿ“ฆ

Learning: Variables โ€” Storing Your Inventory

๐ŸŽ’
โญโญโ˜†โ˜†โ˜† Easy โฑ 25 min โœจ You'll make: A character stat sheet with your name, weapon, and gold count

๐Ÿ“– The Story

Your character has levelled up and urgently needs an inventory system! In every great RPG, your hero carries weapons, gold coins, and magical potions in a backpack. Python lets you store all this information in Variables โ€” special labelled boxes that remember things for you. Time to pack your adventurer's backpack! โš”๏ธ

๐Ÿ’ก The Big Idea

A variable is a labelled box that holds a value. Write the name on the left, then use = to put something inside. There are three main types of box:

hero_name = "Zara" โ† text (string) gold_coins = 250 โ† number (int) has_shield = True โ† yes/no (bool)   print("Name:", hero_name) โ†’ Name: Zara

๐Ÿ–ฅ๏ธ Do This in PyCharm

  1. 1
    Open chapter_2_inventory_boxes.py in PyCharm (double-click it in the left panel).
  2. 2
    Press โ–ถ Run first to see the default hero. Notice how the variables control what gets printed!
  3. 3
    Find # TODO #1 and change player_name to YOUR name. Keep the " " quotes around it โ€” text always needs them!
  4. 4
    Fill in your weapon, your power level (a plain number โ€” no quotes!), and set has_dragon to True or False.
  5. 5
    Press โ–ถ Run again. Your personalised character sheet and inventory chest will display!

๐Ÿ‘€ What to Look For in PyCharm

In the Run Console at the bottom, look for:

  • โœ… Your actual name next to "Adventurer:"
  • โœ… The weapon you invented
  • โœ… A neat inventory chest made with = characters

๐ŸŽ‰ Your name in the output means your variable WORKED โ€” you stored data like a real programmer!

๐Ÿ† After This Chapter You'll Know:

Variables Strings (text) Integers (numbers) Booleans True/False
CH 3

The Secret Doors ๐Ÿšช

Learning: if / elif / else โ€” The Fork in the Road

๐Ÿ”€
โญโญโ˜†โ˜†โ˜† Easy โฑ 30 min โœจ You'll make: A password-protected secret room that reacts to your answer

๐Ÿ“– The Story

Deep in the Python Dungeon, three mysterious doors block your path. Each leads to a completely different fate โ€” treasure, dragons, or a hidden passage. Python can choose which door to open using if / elif / else. It checks a condition, then takes the right path automatically. This is how programs make decisions! ๐Ÿฐ

๐Ÿ’ก The Big Idea

if / elif / else is a fork in the road. Python checks each condition top to bottom โ€” the first one that's True wins, and its block of code runs.

if door == "red": print("Dragon ahead! ๐Ÿฒ") elif door == "blue": print("Treasure found! ๐Ÿ’ฐ") else: print("Secret passage! ๐ŸŒ€")

๐ŸŒŸ New Spell: the f-string!

This chapter also unlocks the f-string โ€” a way to drop a variable inside your text. Put an f before the first quote, then wrap the variable in {curly braces}:

score = 95 print("Score:", score) # the comma way print(f"Score: {score}") # the f-string way!

You'll see f-strings everywhere from now on โ€” they make printing much tidier!

๐Ÿ–ฅ๏ธ Do This in PyCharm

  1. 1
    Open chapter_3_secret_doors.py in PyCharm.
  2. 2
    Press โ–ถ Run. This chapter uses input() โ€” the program will pause and wait for you to type! Look for the blinking cursor in the Console.
  3. 3
    Type the password shown in the file and press Enter. See what happens when you get it right โ€” and wrong!
  4. 4
    Find # TODO #1 and change secret_password to something only YOU would know. Run it again and test your new password!
  5. 5
    Find # TODO #2 and # TODO #3 to customise the three-door challenge. Change the door colour and add your own secret word!

๐Ÿ‘€ What to Look For in PyCharm

When you run this file the Console will PAUSE and show a question. This is input() asking for your answer! Look for:

  • โœ… A question with a blinking cursor โ€” type your answer and press Enter
  • โœ… A different message depending on what you typed
  • โœ… The "โœ… door opens" message when you nail the right password

๐ŸŽ‰ Different output for different inputs = your if/else logic is WORKING!

๐Ÿ† After This Chapter You'll Know:

if / elif / else input() == comparison f-strings Decision Logic
CH 4

The Repeat Potions ๐Ÿ”

Learning: for loops & while loops

โš—๏ธ
โญโญโญโ˜†โ˜† Medium โฑ 30 min โœจ You'll make: An animated potion-brewing machine with a live progress bar

๐Ÿ“– The Story

The wizard's brewery needs 1,000 potions by morning! You could type print("Brewing...") one thousand timesโ€ฆ or you could use a Loop! Loops are the most powerful spells in Python โ€” they make the computer repeat an action over and over without you having to write it over and over. Work smarter, not harder! โ™ป๏ธ

๐Ÿ’ก The Big Idea

A for loop repeats a block of code a set number of times. A while loop keeps repeating until a condition becomes False.

for i in range(5): print("Brewing potion #", i+1) โ†’ Brewing potion # 1 โ†’ Brewing potion # 2 โ†’ Brewing potion # 3 โ€ฆ (5 times total!)

๐Ÿ–ฅ๏ธ Do This in PyCharm

  1. 1
    Open chapter_4_repeat_potions.py in PyCharm.
  2. 2
    Press โ–ถ Run and watch the countdown and potion counter appear automatically. That's a loop doing the work!
  3. 3
    Find # TODO #1 and change the number in number_of_potions = 5. Try 3, then 15, then 100. Notice how tiny the code change is for a huge result!
  4. 4
    Find # TODO #2 and change the items list. Find # TODO #3 and change the magic power word (try "legendary" or "cursed"!).
  5. 5
    The Success Challenge at the bottom runs an animated progress bar! The output prints slowly on purpose โ€” watch the ๐Ÿงช symbols fill up one by one.

๐Ÿ‘€ What to Look For in PyCharm

This chapter has animated output! Because of time.sleep() the Console prints line by line with short pauses. Watch for:

  • โœ… Lines appearing one at a time with a slight delay
  • โœ… The progress bar growing as ๐Ÿงช symbols fill in
  • โœ… The while loop countdown ticking from 5 โ†’ 4 โ†’ 3 โ†’ 2 โ†’ 1 โ†’ ๐ŸŽ†

๐ŸŽ‰ Your loop runs live = you've unlocked Python Programmer Superpowers!

๐Ÿ† After This Chapter You'll Know:

for loops range() while loops Lists [ ] time.sleep()
CH 5

Function Spells ๐Ÿ”ฎ

Learning: def, parameters, return

โš—๏ธ
โญโญโญโ˜†โ˜† Medium โฑ 35 min โœจ You'll make: A reusable spell announcer that introduces any hero with one call

๐Ÿ“– The Story

The master brewer of the Potion Guildhall has a secret โ€” he never re-invents a recipe. He writes it once, then any apprentice can follow it a thousand times. Python functions work the same way: define a block of steps once with def, then call it whenever you need it, anywhere in your program. ๐Ÿง™

๐Ÿ’ก The Big Idea

Write a function once with def. Pass in data via parameters. Get a result back with return.

def greet(name): print("Hello, " + name)   greet("Aria") โ†’ Hello, Aria greet("Bolt") โ†’ Hello, Bolt

๐Ÿ–ฅ๏ธ Do This in PyCharm

  1. 1
    Open chapter_5_function_spells.py in PyCharm.
  2. 2
    Press โ–ถ Run and watch greet_hero() get called three times from a single definition.
  3. 3
    Find # TODO #1 โ€” change "Adventurer" to YOUR name in the function call.
  4. 4
    Find # TODO #2 โ€” change "Warrior" to your chosen class and run again.
  5. 5
    Find # TODO #3 & #4 โ€” write a full_hero_name function with a return statement and call it with your own name parts.

๐Ÿ‘€ What to Look For in PyCharm

In the Run Console look for:

  • โœ… greet_hero() printing the exact same output three times โ€” that's the power of reuse
  • โœ… Your name appearing in the personalised call
  • โœ… The Spell Catalogue at the end showing each spell formatted by your function

๐ŸŽ‰ One function, many calls = your code is now reusable!

๐Ÿ† After This Chapter You'll Know:

def Parameters return Calling functions
CH 6

List Quests ๐Ÿ“‹

Learning: Lists โ€” collections of items

โš”๏ธ
โญโญโญโ˜†โ˜† Medium โฑ 30 min โœจ You'll make: A party roster you can add heroes to, remove them, and loop through

๐Ÿ“– The Story

Your adventuring party needs an official Roster! Until now every variable held one thing at a time. A List holds many things in order โ€” inside a single variable. Add heroes when they join, remove them when they leave, loop through the whole party in three lines of code. ๐Ÿ“œ

๐Ÿ’ก The Big Idea

Square brackets [ ] create a list. Items are separated by commas. Access any item by its index number โ€” Python counts from 0!

party = ["Aria", "Bolt", "Zara"] print(party[0]) โ†’ Aria party.append("Nova") print(len(party)) โ†’ 4

๐Ÿ–ฅ๏ธ Do This in PyCharm

  1. 1
    Open chapter_6_list_quests.py in PyCharm and press โ–ถ Run to see the default party roster.
  2. 2
    Find # TODO #1 โ€” change the three hero names to characters YOU invented.
  3. 3
    Find # TODO #2 โ€” use .append() to add a 4th hero of your choice.
  4. 4
    Find # TODO #3 โ€” use .remove() to dismiss one hero from the party.
  5. 5
    Find # TODO #4 โ€” replace the inventory items with your own gear and re-run to see the loop display them all.

๐Ÿ‘€ What to Look For in PyCharm

In the Run Console look for:

  • โœ… Your invented hero names in the party roster
  • โœ… The party size updating correctly after add and remove
  • โœ… The Quest Board at the end โ€” a numbered list built entirely from a list variable

๐ŸŽ‰ A loop over a list = you can process any number of items with just 2 lines!

๐Ÿ† After This Chapter You'll Know:

Lists [ ] Indexing [0] append / remove len() for item in list
CH 7

The Random Oracle ๐ŸŽฒ

Learning: import random

๐Ÿƒ
โญโญโ˜†โ˜†โ˜† Easy โฑ 25 min โœจ You'll make: A random loot drop system and a Magic 8-Ball fortune teller

๐Ÿ“– The Story

Real games need unpredictability โ€” dice rolls, surprise loot drops, critical hits that change everything. Python's random module is the Oracle that never gives the same answer twice. Roll dice, draw fate cards, and build a battle simulator whose outcome changes every single run! ๐ŸŽฒ

๐Ÿ’ก The Big Idea

import random loads the module. Three key spells: randint() rolls a die, choice() draws from a list, shuffle() scrambles one.

import random random.randint(1, 20) โ†’ 14 (different every run!) random.choice(["fire", "ice", "thunder"]) โ†’ "ice" (random pick)

๐Ÿ–ฅ๏ธ Do This in PyCharm

  1. 1
    Open chapter_7_random_oracle.py and press โ–ถ Run. Then run it again โ€” notice the output is different!
  2. 2
    Find # TODO #1 โ€” change randint(1, 6) to a different dice. Try (1, 100)!
  3. 3
    Find # TODO #2 โ€” replace the 5 loot items with your own invented treasures.
  4. 4
    Find # TODO #3 โ€” write 5 Magic 8-Ball answers: some yes, some no, some mysterious.
  5. 5
    Run the Battle Simulator at the bottom 3 times โ€” every fight has a different hero, enemy, and outcome!

๐Ÿ‘€ What to Look For in PyCharm

In the Run Console look for:

  • โœ… Different dice numbers every time you press โ–ถ Run
  • โœ… Your own loot item appearing in the drop
  • โœ… The Battle Simulator โ€” different heroes, enemies, and winners each run

๐ŸŽ‰ When your output changes every run โ€” randomness is working!

๐Ÿ† After This Chapter You'll Know:

import random randint() choice() shuffle()
CH 8

String Sorcery ๐Ÿ”ค

Learning: String methods & the in operator

๐Ÿ“œ
โญโญโญโ˜†โ˜† Medium โฑ 30 min โœจ You'll make: A magic name generator that builds hero names from word pieces

๐Ÿ“– The Story

The kingdom's most powerful wizards carry a Translation Stone โ€” press it to any scroll and it transforms the words: SHOUT them, whisper them, swap one word for another, or search for a hidden message buried in the text. Python string methods are your Translation Stone! ๐Ÿ”ฎ

๐Ÿ’ก The Big Idea

Strings have built-in methods you call with a dot. The in operator searches inside a string and returns True or False.

s = "fireball" s.upper() โ†’ "FIREBALL" s.replace("fire", "ice") โ†’ "iceball" "ball" in s โ†’ True

๐Ÿ–ฅ๏ธ Do This in PyCharm

  1. 1
    Open chapter_8_string_sorcery.py and press โ–ถ Run to see all the text transformations.
  2. 2
    Find # TODO #1 โ€” change "adventurer" to YOUR name and see it displayed in all four forms.
  3. 3
    Find # TODO #2 โ€” change the sentence and the words being replaced.
  4. 4
    Find # TODO #3 โ€” change search_word to a word that IS or IS NOT in the scroll. Try both!
  5. 5
    Run the Magic Name Generator at the bottom โ€” run it 5 times and collect your favourite generated hero name!

๐Ÿ‘€ What to Look For in PyCharm

In the Run Console look for:

  • โœ… Your name appearing in four different forms (original, UPPER, lower, Title)
  • โœ… A word in your sentence getting swapped out by .replace()
  • โœ… A randomly generated hero name + battle shout at the end

๐ŸŽ‰ Transforming text with one line = string methods mastered!

๐Ÿ† After This Chapter You'll Know:

.upper() / .lower() .replace() .split() len() "x" in s

๐Ÿ† Quest Complete!

You've mastered all eight chapters of The Main Path!

๐Ÿช„ Text Wizard
๐Ÿ“ฆ Variable Master
๐Ÿšช Decision Maker
๐Ÿ” Loop Caster
๐Ÿ”ฎ Function Forger
๐Ÿ“‹ List Keeper
๐ŸŽฒ Oracle Reader
๐Ÿ”ค String Sorcerer

Ready for more? Try the Full Course (11 chapters) โ€” or combine everything you know to build your own text adventure game!