Why Python, and Running Your First Program
Why Python is the best first language, how to install it, and your very first line of code.
Why Python is the language to learn first
If you are going to learn exactly one programming language, learn Python. There is a reason it is the most taught language in universities, the default language of artificial intelligence, and the tool that data scientists, web developers, and automation engineers all reach for. Python reads almost like plain English, which means you spend your energy learning to think like a programmer instead of fighting confusing syntax.
Here is the same idea — print a greeting — in two languages. First, in a language called Java:
public class Main {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
And now in Python:
print("Hello, world!")
One line. No boilerplate, no ceremony. That clarity is exactly why beginners move faster in Python and why experts stay in it for serious work.
What you can actually build with Python
Python is not a toy language you grow out of. The same language you are about to learn powers some of the biggest systems in the world:
- Artificial Intelligence and Machine Learning — ChatGPT, recommendation engines, and image recognition are built with Python tools like PyTorch and TensorFlow.
- Data Science — analysts use Python (pandas, NumPy) to find patterns in millions of rows of data.
- Web backends — Instagram, Spotify, and Dropbox run Python on the server.
- Automation — boring repetitive tasks (renaming files, sending emails, scraping websites) become five-line scripts.
So this is not wasted effort. The foundation you build here carries directly into the highest-paid, fastest-growing areas of tech.
Getting Python onto your computer
To run Python on your own machine, you install it once from the official website, python.org. On Windows, download the installer and — this is the one step beginners miss — tick the box that says "Add Python to PATH" before clicking Install. That checkbox lets you run Python from anywhere.
To check it worked, open your terminal (Command Prompt on Windows, Terminal on Mac) and type:
python --version
If you see something like Python 3.12.1, you are ready. The "3" matters — Python 2 is long dead, and everything in this course uses Python 3.
That said, you don't even need to install anything to start. The playground built into this lesson runs Python right in your browser, so you can follow along immediately and install later when you are ready to build bigger projects.
Your first real program
Let's write something slightly more interesting than "Hello, world". This program asks for your name and greets you:
name = input("What is your name? ")
print("Hello, " + name + "! Welcome to Python.")
Two new ideas appear here. input() pauses the program and waits for the user to type something, then hands that text back. We store it in a labelled box called name. Then print() stitches our greeting together and shows it on screen. The + between pieces of text glues them together.
Run it. Type your name. The computer greets you by name. You just wrote an interactive program — congratulations, you are now a programmer. Everything from here is building on these two simple actions: take input, produce output.
How a Python program actually runs
When you run a Python file, a program called the interpreter reads your code one line at a time, top to bottom, and does exactly what each line says. There is no hidden magic and no "compile" step you need to think about. This top-to-bottom flow is the single most important mental model for a beginner: the computer does not skip around or guess your intent — it follows your instructions in order, literally.
Because it runs line by line, you can test ideas instantly. Change one line, run again, see the result. This tight feedback loop is how you will learn fastest: don't just read the examples, run them, break them, and fix them. Every time you change a value and predict the output before running, you are training the exact instinct that makes a good programmer.
In the next chapter we'll look at variables and data types properly — the boxes where your program keeps its information.
Finished "Why Python, and Running Your First Program"?
Mark this chapter complete so you can pick up exactly where you left off. Your progress saves locally — sign in to sync across devices.
Was this chapter clear?
