Python for Beginners › Module 1: Getting Started › Lesson 1.1

What Is Programming?

Module 1 is freeLesson 1.1 · about 20 minutes · no coding experience needed

Python loads when you first use a code box

Get the full course

13 modules of live, in-browser Python — real code you run yourself, no installs. Lessons 1.1 and 1.2 are free; the rest of the course is Rs. 300 + 18% GST.

Enroll Now — Rs. 354.00

By the end of this lesson you will be able to

  • explain, in your own words, what a computer program is
  • explain why instructions to a computer must be exact and in the right order
  • say what Python is, and why this course teaches it
  • run a piece of code on this website for the first time

A computer only does what it is told

A computer cannot guess what you mean. It cannot use common sense, and it cannot fill in a gap the way a person can. It can only follow instructions, written in a language it understands, one step at a time. A program is simply a list of such instructions.

You give exact instructions all the time without thinking of it as programming. Suppose you asked someone who had never made tea before to make you a cup. You might say:

  1. Boil water in a pan.
  2. Add two spoons of tea leaves.
  3. Let it boil for two minutes.
  4. Add milk and sugar to taste.
  5. Pour through a strainer into a cup.

Every step matters, and so does the order. Add the milk before boiling and you get a different result. Skip the strainer and you get tea leaves in your cup. A computer follows instructions exactly like this: precisely, in order, with no assumptions of its own.

A word you will meet often: code

The instructions a programmer writes are called code, and writing them is called coding. Later in this course you will read words like “program”, “code” and “script” used to mean much the same thing: a set of instructions written for a computer to follow.

Why order and exactness matter

Here are two sets of instructions for crossing a road. Read both before deciding which is safer.

  1. Look both ways
  2. Wait for a gap
  3. Cross

Now the same three instructions, reordered:

  1. Cross
  2. Look both ways
  3. Wait for a gap

The instructions are identical. Only the order changed, and that alone makes the second version dangerous. A person can often notice a badly ordered instruction and correct it. A computer cannot: it will follow the steps precisely as written, in the order given, even into a mistake. This is the single most important idea in programming, and you will see it again in Lesson 1.2, where the order of your instructions decides the order the results appear on the screen.

Which of the two road-crossing lists above would a computer still follow exactly, even though it leads to a bad outcome?

What is Python?

Python is a programming language: a way of writing instructions that a computer can follow. There are many programming languages, in the same way there are many human languages, but Python is one of the most widely used in the world. It runs websites, analyses data, powers artificial intelligence tools, and automates everyday tasks in offices everywhere, from Cochin to California.

This course teaches Python for three practical reasons:

How this course works

This is a text course with no videos, but it is not a course you only read. Every lesson has boxes of real, working Python code, right here on the page. You read them, run them, change them, and see what happens.

Try it now: tap the blue Run button below the box. The result will appear underneath it.

Notice what just happened: nothing was installed, and nothing was sent to any server. Python ran inside this page, in your own browser, and showed you a result. That is how every code box on this course works, from here to the very last lesson.

You do not yet know what that line of code means; that is exactly what Lesson 1.2 teaches, in detail. For now, try changing the words inside the quotation marks to a sentence of your own, and press Run again.

Why nothing needs installing

Normally, using Python means installing it on a computer first. This course avoids that, because it would be one more thing to get right before you had even started. Instead, this page brings a complete copy of Python into your browser the first time you press Run. It takes a few seconds the first time, and is instant afterwards, for the rest of this lesson. Moving to a new lesson loads it again, since each page starts fresh.

What you will build

Programming is learned by doing, not by reading about it, so this course is built around short, real tasks rather than long explanations. Across the coming lessons in this module you will:

Later modules build on this, through decisions, repetition, and small complete projects. Each lesson assumes only what earlier lessons taught, so if a word is unfamiliar, it will have been explained already or will be explained where it first matters.

Quick check

Three questions to confirm the main ideas before you move on.

1. What is a computer program?

2. Why does the order of instructions matter to a computer?

3. What do you need to install on your own computer to do the exercises in this course?

Summary

  • A program is a list of exact instructions for a computer to follow, one step at a time.
  • A computer cannot guess your meaning or notice a mistake in the order of instructions; it follows them exactly as given.
  • Python is a widely used programming language, chosen for this course because it reads clearly and rewards beginners quickly.
  • Every code box on this course runs real Python inside your own browser. Nothing needs to be installed.

Found a mistake on this page, or something unclear? Report a problem and mention “Python Lesson 1.1”.