0Pricing
Python For Kids · Lesson

Your First Python Code

Write and run your very first Python program.

Your First Python Code is a free Python For Kids lesson on CoddyKit — lesson 4 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 Python For Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

1

Your First Python Code

Welcome to your first Python lesson! Today, you'll write your very first Python program. Let's get started and see how fun coding can be!

Your First Python Code — illustration 1

2

What You Need

Before we begin, make sure you have Python installed and a code editor ready. If you need help setting these up, check out the previous lessons.

3

Opening Your Code Editor

Open your code editor (like IDLE or Visual Studio Code). We're going to write our first line of Python code here.

You can use our online editor and compiler while using the application.

4

Writing Your First Line of Code

Let's write a simple program that tells the computer to say hello. Type the following line into your editor:

print("Hello, Python!")

5

Understanding the Code

The print() function tells Python to display the text inside the quotes. In this case, it will show:

Hello, Python!

6

Since we will use our online editor during the training, you will not need to create an additional project on your computer.

7

Saving Your Program

Save your file with a name like hello.py. The .py extension tells your computer that it's a Python file.

8

Running Your Program

Now, let's see your program in action! 

  1. Open the Command Prompt (Windows) or Terminal (Mac/Linux). 
  2. Navigate to the folder where you saved hello.py
  3. Type python hello.py and press Enter.

You should see:


Hello, Python!

8

Adding More Messages

Let's make your program say more things. Add another print() line below the first one:

Run your program again. Now you'll see two messages!

print("Hello, Python!")
print("I'm excited to learn programming!")

9

10

Great Job!

You’ve written and run your first Python program! Keep practicing by adding more print() statements and see what you can create.

Your First Python Code — illustration 11

Frequently asked questions

Is the “Your First Python Code” lesson free?

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

What will I learn in “Your First Python Code”?

Write and run your very first Python program. You practise Python 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 Python For Kids?

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

How long does the “Your First Python Code” 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 Python For Kids lesson?

Yes. Every Python 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. What is Programming?
  2. Why Learn Python?
  3. Tools and Environment Setup
  4. Your First Python Code
← Back to Python For Kids