Kahibaro
Discord Login Register

What is a computer program?

Understanding Computer Programs

A computer program is a set of precise instructions that a computer can follow to do something.

You can think of it like:

Programs can be tiny (a few lines) or huge (millions of lines), but they all have the same basic purpose: to tell the computer exactly what to do.

Programs vs. Apps vs. Scripts

You might hear different words:

All of these are, at their core, computer programs.

What Does a Program Actually Do?

Most computer programs do some version of the same basic things:

  1. Receive input
    • From the keyboard, mouse, files, the internet, sensors, etc.
    • Example: A login form receives your username and password.
  2. Process data
    • Apply rules, calculations, or decisions to the input.
    • Example: Check if the password is correct.
  3. Store or retrieve data
    • Save information for later, or load previously saved data.
    • Example: Load your saved game, save a document, update a database.
  4. Produce output
    • Show text, images, sound, or send data elsewhere.
    • Example: Show “Login successful”, display a web page, play a song.

You can picture it like a simple flow:

$$\text{Input} \rightarrow \text{Processing} \rightarrow \text{Output}$$

Many real programs repeat this cycle over and over.

Programs Are Written in Programming Languages

Computers only understand very simple, low-level instructions (often called machine code). These are hard for humans to read and write, so we use programming languages instead.

A programming language is:

Examples: Python, JavaScript, C, Java, etc.

A computer program is the result of writing instructions in one of these languages.

You’ll learn the details of Python itself later; for now, just keep in mind:

How Programs Run

When you write a program, it doesn’t do anything until it is run (or executed). Running a program means:

Conceptually:

  1. You write the program.
  2. The computer reads and executes it.
  3. You see the result (output, changed files, etc.).

Behind the scenes, there may be an interpreter (like Python) or a compiler translating your code into something the computer can work with, but the big picture is: your instructions get turned into actions.

Simple Examples of Programs

Here are some different kinds of computer programs you might recognize:

Even though these look very different, they are all computer programs: they receive input, process it, and produce output based on rules written by a programmer.

Programs Follow Rules Exactly

Computers do not “guess” what you meant. A key property of computer programs is that they are:

If instructions are:

…then the program will fail, crash, or behave unexpectedly.

This is why programming requires careful thinking about the steps and rules you give to the computer.

Where Do Programs Live?

Programs can exist in several forms:

When you double-click an icon, tap an app, or visit a web page that runs code, you are causing a computer program to run somewhere (on your device, on a remote server, or both).

Why Understanding Programs Matters

Before you start writing code, it helps to be clear about what a program is:

In the rest of this course, you’ll learn how to use Python to write your own computer programs: small, precise sets of instructions that tell a computer exactly what to do.

Views: 21

Comments

Please login to add a comment.

Don't have an account? Register now!