Coding for Kids · Lesson

Filling the Story

Put words in a template.

Lesson 2 of 413 steps

Filling the Story is a free Coding for Kids lesson on CoddyKit. This is lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Coding for Kids learning path, and your progress syncs across the web and the CoddyKit app. The Coding for Kids course includes 4 lessons in total.

Fill in the Story! 📖✏️

Now we put the words INTO a story! 🤪 Like a fill-in-the-blank game!

The story has blank spots, and we drop the player's words right in. Let's learn how! 🎉

animal = 'penguin'
print('Once there was a', animal)

Joining Words With Commas

One way to fill a story is to print with commas! 📝

Python puts a space between each part. The boxes drop right into the sentence!

animal = 'tiger'
food = 'pizza'
print('The', animal, 'loved to eat', food)

A Two-Word Story 🎬

Let's use a noun and a verb in one sentence! 🎬

'The DRAGON likes to JUMP.' We just slot the boxes into the print!

noun = 'dragon'
verb = 'dance'
print('The', noun, 'loves to', verb, 'all day!')

The Super Way: f-strings ✨

There's a fancy way to fill blanks called an f-string! ✨

Put f before the quotes, then wrap each box in curly braces like this: 'My pet is a {animal}'. So neat!

animal = 'unicorn'
print(f'My pet is a {animal}')

Why f-strings Are Great 🌟

With f-strings, the story reads just like a normal sentence! 🌟

The words in { } get replaced with the box's value. Super easy to read!

color = 'purple'
food = 'tacos'
print(f'The {color} monster ate 100 {food}!')

Fill Multiple Blanks 🎯

An f-string can have LOTS of blanks! 🎯

Each {box} gets filled. The more blanks, the sillier the story!

animal = 'frog'
place = 'moon'
verb = 'sing'
print(f'A {animal} flew to the {place} to {verb}!')

A Story Template 📋

A template is a story with blanks waiting to be filled! 📋

We write the whole story once with { } spots, then fill it with any words!

hero = 'Captain Banana'
monster = 'spaghetti'
print(f'{hero} fought the giant {monster} and won!')

Use the Player's Words 🗣️

Let's combine input AND the template! The player's words fill the blanks! 🤩

First ask, then fill. A real silly story machine!

animal = 'llama'
verb = 'sneeze'
print(f'My pet {animal} likes to {verb} every morning!')

A Longer Story 📜

Let's make a story with several sentences! 📜

We can use many prints, each with blanks, to tell a whole tale!

name = 'Zoe'
animal = 'octopus'
food = 'donuts'
print(f'{name} had a pet {animal}.')
print(f'It loved to eat {food} all day.')
print('The end! 🎉')

Make It Extra Silly! 🤪

The funnier the words, the funnier the story! 🤪

Mix unexpected words for the biggest laughs. A 'dancing refrigerator'? Why not! 🕺

thing = 'refrigerator'
verb = 'dance'
place = 'a volcano'
print(f'The {thing} began to {verb} on top of {place}!')

Fill Your Own Story! 📖🎨

Your turn! Change the boxes to YOUR silly words. 🤩

Make up the wackiest sentence you can! 🎪

animal = 'hippo'
color = 'rainbow'
verb = 'giggle'
print(f'A {color} {animal} loves to {verb} in the rain!')

Quick Check ✅

Story-filling brain teaser! 🧠📖

Story Filled! 📖🎉

Awesome! You can fill stories with words now! You learned:

  • print with commas joins words 📝
  • f-strings use {box} to fill blanks ✨
  • A template is a story with blanks 📋
  • Sillier words make funnier stories 🤪

Next: print the whole funny story nicely! 🖨️

Free to start

Learn Python with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
35
Lessons
140

Frequently Asked Questions

Is the “Filling the Story” lesson free?

Yes — the full text of “Filling the Story” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Coding for Kids course, upgrade to CoddyKit PRO. The Coding for Kids course includes 4 lessons in total.

What will I learn in “Filling the Story”?

Put words in a template. You practise Coding for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Coding for Kids?

No prior experience is required. Coding for Kids on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 2 of 4.

How long does the “Filling the Story” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Coding for Kids lesson?

Yes. Every Coding for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Collecting Words
  2. Filling the Story
  3. Printing the Story
  4. Make Your Own
← Back to Coding for Kids