Michael Kölling’s thought-provoking post, “GUIDELINE 4: DON’T USE ‘HELLO WORLD’,” really struck a chord with me. As a teacher, I’ve ,at times, felt that starting students off with “Hello World” is not only uninspiring but also a missed opportunity. The first moments of any lesson, especially when teaching something as potentially intimidating as programming, are crucial. It’s our chance to show students that coding is exciting, personal, and, above all, fun.
In this post, I want to explore how we can replace “Hello World” with creative, engaging alternatives that better capture students’ imaginations. I’ll also reflect on how these approaches have worked in the classroom and how they align with the goal of making programming more accessible to beginners.
I have added all code in two forms, the first is an image created with Carbon to Visually make the code stand out in case you’d like to use the image yourself or share this with students. The second, is the plain text code to make copying it into your own lesson plans or IDE of choice easier.
Fun First Lines of Code
Let’s start with the simplest way to improve the traditional “Hello World” program—by injecting a bit of personality and humour into it. For students who are encountering coding for the first time, this can make all the difference.
Here are a few examples:
A Friendly Greeting:
print("Welcome to the world of coding, explorer!")
I’ve used variations of this in class, and the reactions are always positive. Students feel welcomed into a new “world,” and it sets the tone for coding as an adventure. Some even start asking, “What’s next?” before we’ve moved on to the second line of code!
Emoji Greeting
print("😃 Welcome to the world of Python! 🚀")
Adding emojis makes the output visually fun, especially for younger students. It’s a great way to break the ice and add a playful tone to coding lessons.
A Programming Pun:
print("Why did the Python coder stay calm? They had their 'try' block covered!")
Sharing a pun, or having the students come up with their own, makes the room feel lighter(read: less serious or stressful if they are new to coding), especially for students who might be nervous about making mistakes. It’s a reminder that coding doesn’t have to be overly serious, and it often helps establish a safe space where students feel it’s okay to have fun while learning.
A Fun Fact:
print("Did you know? Snakes can code too—at least in Python!")
Fun Facts like this create a little buzz in the room. Students love sharing them with their friends, and it makes them feel like they’re learning something quirky and cool. It’s a great way to blend curiosity with learning and infuse the tasks with your students’ interests.
A Joke to Break the Ice:
print("Why did the computer go to art school? It wanted to brush up on its skills!")
Similar to the previous examples of puns and fun facts, sharing a simple joke can transform the atmosphere of a class. When I use a joke like this, and let them share their favourites, I often see students relax and lean into the activity more. It’s also a great way to connect with students who might not yet see themselves as “tech-savvy.”
Building Interaction
Once students are comfortable with the basics, I like to introduce programs that allow them to interact with the code. This keeps them engaged and shows them that coding is not just about following instructions—it’s a way to create something dynamic and personal.
Personalised Greeting with a Twist
Instead of just asking for their name, let’s add a creative scenario to make the interaction more exciting:
name = input("What's your name, brave adventurer? ")
print(f"Greetings, {name}! Your quest begins now. May the coding gods be with you!")
Why It’s Better: By framing the prompt as part of an adventure, students feel like they’re stepping into a game or story, which makes it more immersive and fun.
Mad Libs 2.0: A Silly Scene
Give students a playful setup that creates a funny mental image:
animal = input("Name a strange animal: ")
sound = input("What funny sound does it make? ")
print(f"One day, a {animal} walked into a classroom and shouted '{sound.upper()}!' Everyone laughed!")
Why It’s Better: Encouraging silliness makes students laugh and engage more. The story element also shows them how coding can be creative.
Animal Sounds Game
animal = input("What’s your favourite animal? ")
sound = input(f"What sound does a {animal} make? ")
print(f"The {animal} goes '{sound}', and that’s awesome!")
This is a hit with younger learners, who love personalising their answers. It’s also a natural way to introduce the idea of variables while tapping into their creativity.
Build-Your-Own Superhero Name
first_name = input("Enter your first name: ")
favourite_colour = input("What’s your favourite colour? ")
print(f"Your superhero name is {favourite_colour.capitalize()} {first_name}!")
Students love coming up with silly superhero names. It’s a fun way to spark creativity and introduce string manipulation.
Mini Calculator with Real-World Fun
Let’s make the numbers part of a story:
num1 = int(input("How many pizzas are you ordering? "))
num2 = int(input("How many friends are you sharing with? "))
print(f"Great choice! That's {num1 + num2} slices to share. Enjoy the pizza party!")
Why It’s Better: Connecting the numbers to a real-life scenario makes the math feel more relatable and fun, especially when food is involved! And as the original article says, Maths(Even though I love it, is still many students least favourite subject)
Fortune Teller
Here’s another idea that adds an element of surprise and fun:
name = input("What's your name? ")
question = input("What question do you have for the coding oracle? ")
print(f"The oracle says: '{name}, the answer to your question (“{question}”) is... Yes!'")
Why It’s Better: This introduces creativity and randomness, and students love the idea of a “magic” program answering their questions. You can expand this later to include randomised answers!
Why this works in the Classroom
- Engagement: These small changes create a sense of fun and curiosity, helping even the most hesitant learners feel excited about coding.
- Creativity: Students often try their own variations, adding to the excitement. For example, they may add their own silly sounds or scenarios.
- Memorability: These activities stick with students because they’re not just coding—they’re laughing, imagining, and creating stories.
By tweaking these simple programs, we can turn a routine coding lesson into an engaging and memorable experience. Students don’t just learn the basics of programming—they also start to see it as a tool for creativity and fun.
Real-World Mini Projects for Beginners
One of Michael Kölling’s key points was the importance of showing students why programming is useful. When students see how coding can solve real problems or create something meaningful, their motivation skyrockets. By introducing beginner-friendly projects that connect to their world, we can ignite that spark of interest and curiosity. Here are a few examples that I’ve used successfully in my classes, along with some classroom reflections.
Budget Calculator
Making Money Math Fun
income = float(input("What’s your monthly income? "))
expenses = float(input("What are your monthly expenses? "))
print(f"You’re saving £{income - expenses} per month!")
This example is fantastic for older students, especially those starting to think about money and budgeting. The program gives them a concrete way to see how coding can help solve everyday problems. Plus, it opens the door to deeper discussions about financial literacy, which is a key life skill.
Students often ask questions like, “What if I have more than one expense?” This leads to extensions of the project, such as adding multiple expenses or even including savings goals. The best part? These discussions about real-world financial concepts help students see that coding isn’t just about numbers—it’s about solving meaningful problems.
Fun Extension Idea: Allow students to add categories like rent, groceries, and entertainment to make the calculator more accurate and interactive. You can also ask them to add a savings goal that tracks their progress!
Let’s build on the original idea by adding categories to break down expenses:
income = float(input("What’s your monthly income? "))
rent = float(input("How much do you spend on rent? "))
food = float(input("How much do you spend on food? "))
other = float(input("What about other expenses? "))
total_expenses = rent + food + other
savings = income - total_expenses
print(f"Your total expenses are £{total_expenses}. You’re saving £{savings} per month!")
This enhanced version makes the program feel more personal and practical. Students can see how categorising expenses helps them visualise where their money is going. In the classroom, you can relate this to real-life budgeting skills, encouraging discussions about financial literacy and how technology supports personal organisation.
Guess the Number Game
Building Engagement Through Play
import random
number = random.randint(1, 10)
guess = int(input("Guess a number between 1 and 10: "))
if guess == number:
print("You got it! Great guess!")
else:
print(f"Oops, it was {number}. Better luck next time!")
This classic game is a classroom favourite. It’s simple, but its randomness brings excitement and energy. It also provides an excellent way to teach students about logic, conditionals, and loops as they start to experiment with adding more features to the game. I’ve had students suggest variations, like adding a ‘high’ or ‘low’ hint after each guess, which introduces them to more advanced programming concepts.
Fun Extension Idea: To make it more interactive, ask the class to guess the number faster with a time limit, or introduce a “score” that tracks how many guesses it takes to get the number right. You could even turn this into a competition, where students can try to ‘beat’ the game or each other in terms of how few guesses they need.
We can improve the guessing game by adding multiple attempts and hints:
import random
number = random.randint(1, 20)
attempts = 3
print("Guess a number between 1 and 20. You have 3 attempts!")
for i in range(attempts):
guess = int(input(f"Attempt {i + 1}: "))
if guess == number:
print("You got it! Great guess!")
break
elif guess < number:
print("Too low!")
else:
print("Too high!")
if guess != number:
print(f"Out of attempts! The correct number was {number}. Better luck next time!")
Adding hints and limiting attempts turns this into a strategy-based game. Students enjoy the challenge, and it encourages logical thinking. Classroom competitions can make it even more exciting, with small rewards for those who guess correctly.
Flashcard Quiz
Coding as a Cross-Curricular Tool
flashcards = {"Python": "a programming language", "HTML": "a web page language"}
for word, meaning in flashcards.items():
print(f"What is {word}?")
input("Press Enter to see the answer...")
print(f"Answer: {meaning}\n")
Flashcard quizzes are not only fun but also educational. This project shows students how coding can be a tool for reinforcing knowledge in all subjects, not just computer science. It’s versatile enough that it can be adapted for any topic—science, history, even languages. By writing their own flashcards, students learn about both coding and the topic they’re studying. It encourages critical thinking and helps them see the real-world applications of programming in education.
Fun Extension Idea: Add features like randomised questions or a scoring system that tracks how many answers students get right. You could also introduce different levels of difficulty for more advanced learners. This gives students room to challenge themselves and allows for differentiation.
Make the flashcard program more interactive by adding a score counter and custom flashcards:
flashcards = {"Python": "a programming language", "HTML": "a web page language", "CSS": "a styling language"}
score = 0
print("Welcome to the Flashcard Quiz!")
for word, meaning in flashcards.items():
answer = input(f"What is {word}? ")
if answer.lower() == meaning:
print("Correct!")
score += 1
else:
print(f"Oops! The correct answer is '{meaning}'.")
print(f"You got {score}/{len(flashcards)} correct!")
This version gamifies the learning process by introducing a scoring system, which adds motivation for students to get the answers right. By customising the flashcards for other subjects (e.g., history dates, science terms, or language vocabulary), this program becomes a fantastic cross-curricular tool that reinforces subject knowledge while teaching coding
The Bigger Picture: Why These Projects Matter
When you connect coding to the real world, students start to see its value beyond just solving puzzles on the screen. Whether it’s calculating savings, playing a game, or reinforcing learning through flashcards, these mini projects give them hands-on experience with how coding can improve their lives. They see that programming isn’t just about writing lines of code—it’s about creating solutions, having fun, and getting things done.
Why They Work:
- Practical Value: These projects directly show how coding can solve problems or support daily life, making the lessons meaningful.
- Engagement: Interactive elements and personalisation keep students interested and invested in their work.
- Scalability: Each project can be expanded with new features, giving students a taste of how coding builds upon itself as skills improve.
In the Classroom:
- Encourage students to brainstorm their own ideas for small projects. This builds ownership of their learning and helps them see how programming can align with their interests.
- Let students personalise their code with their favourite topics or hobbies. For example, instead of a budget calculator, they could track pocket money for something they’re saving up for.
Taking It Further: Engaging Students Beyond the Basics
As students grow more comfortable with these basic projects, we can add layers of complexity to challenge them while keeping things engaging:
- Personalisation: Encourage students to personalise the games or calculators with their own inputs, such as making the flashcards specific to their subjects or adjusting the game difficulty.
- Collaboration: Let students work in pairs to build these projects, allowing them to problem-solve and brainstorm new ideas together.
- Gamification: Introduce concepts like score tracking, levels, and rewards to make these mini projects more game-like.
Ultimately, these real-world projects not only help students develop programming skills—they also show them how coding can be a powerful tool for problem-solving and creativity. When students understand the purpose behind the code, they’re more motivated to keep learning, experiment with new ideas, and develop their skills. By framing programming as a way to make life easier, more fun, and more creative, we can build their passion for coding from day one.
Why This Matters
Starting with “Hello World” is like introducing art by drawing a stick figure; it’s fine, but it doesn’t show students what’s possible. As teachers, we have the opportunity to show our learners that coding is creative, personal, and relevant to their lives.
By using examples that are fun, interactive, or practical, we can help students see the why behind coding, not just the how. It’s about making programming approachable and exciting from the very first moment.
Michael Kölling’s Post
This post was inspired by and builds on the brilliant insights shared by Michael Kölling, which you can read in full here.
What’s your go-to first program when teaching coding? Let’s keep the conversation going and inspire a new generation of programmers!