Free online Python course for kids - Programming for Beginners

Introduction

Session 01: Introduction to Programming

Course Overview | Next Session

Welcome, aspiring programmer!
As Linux users, we already have Python installed, which allows us to start coding right away with the built-in Python Interpreter.

Start the Python Interpreter

To start the Python interpreter, open your terminal and type the following command, then press ENTER:

You should see output that is similar to this:

If you see the above prompt, you are ready to start programming!

  • Note: The presence of the >>> prompt indicates that you are using the Python interpreter.

Close the Python Interpreter

When you’re finished using the Python Interpreter, you’ll need to close it. To do this:

  • Type exit() and press ENTER

If exit() doesn’t work, you can close the terminal window, which will also exit the Python Interpreter.

What We’ve Accomplished So Far:

  1. Started the Python interpreter by typing python3 in the terminal and pressing ENTER.
  2. Exited the Python interpreter by typing exit() and pressing ENTER.

I’m so excited because we just adopted a puppy from the animal shelter. I named him Sam and can’t wait to let my computer know his name. But how do we do that? It’s quite simple, so let’s get started!

Start the Python Interpreter (python3) and type:

Press ENTER. We’ve just instructed the computer to remember that our puppy’s name is Sam. As long as the Python Interpreter is open, the computer will remember this.

Note: We created a variable (puppy_name) to store this information. Variables allow the computer to remember data, whether it’s a dog’s name, a car’s name, or even a banana. Think of variables as building blocks—just like bricks can be used to build a house, variables help us store and manage information.

How to Retrieve the Variable’s Value

To find out the value of our variable, type:

When you press ENTER, the output will be: Sam

Congratulations! You’ve just learned how to retrieve the value stored in a variable. You can now create a variable like this:

And to find out what your favorite fruit is, simply type:

Press ENTER, and the computer will show you the result. Cool, right?

Now it’s your turn to practice! Create (or as programmers say, declare) a variable of your choice—like your favorite car, city, or game. Anything you want can be declared and stored in the computer’s memory (RAM). When you want to retrieve it, use the print() function.

Here’s mine:

Congratulations! You’ve successfully created and printed variables—one of the essential concepts in programming. Remember, don’t rush through this. It’s important to understand how to write and print variables without referring to instructions. Coding, like bonding with a new puppy, takes time and patience.


Course Overview | Next Session