Youcanbuildtech / LearnProgramming Basics with Python
0 of 2 available lessons completeProgress saved in this browser
Lesson 1 of 12

What programming is

Understand what a computer program is and how a computer executes instructions.

Watch What programming is

A computer program is a collection of instructions that performs a task. Code is instructions written using a programming language. Running a program means the computer carries out its instructions in order, from top to bottom. Output is the information or result produced by a program.

Creator-supplied reference narration

What is programming? A program is a set of instructions that tells a computer what to do. Imagine you're giving someone instructions to make a cup of coffee. 1. Get a cup. 2. Put coffee in the cup. 3. Add hot water. 4. Stir the coffee. Those are instructions. If someone follows them in order, they end up with a cup of coffee. Programming works in a similar way. Instead of giving instructions to another person, we're giving instructions to a computer. Let's look at a small program written in Python. Our first instruction tells the computer to display the word "Hello!" Our second instruction tells the computer to calculate two plus three and display the result, which is five. And our third instruction tells the computer to display "Goodbye!" The computer executes these instructions in order, from top to bottom. When we run the program, we can see the results displayed on the screen. Now, here's another simple example. We have two instructions. The first displays the word "First," and the second displays "Second." When we run the program, that's exactly what we get. But what happens if we reverse the order of those instructions? Now "Second" appears before "First." The instructions haven't changed. We've simply changed their order, and the output changes accordingly. Before we finish, there are four important programming terms to remember. Code is the instructions we write using a programming language. Program is a collection of instructions organized to perform a task. Execute, or run, means the computer carries out those instructions. Output is the information or result produced by the program. That's the basic idea behind programming. Programming is telling a computer what to do by giving it instructions it can execute. Now, let's test what you've learned with a short quiz.

Continue to Quiz
Check your understanding

Quiz

Answer each question correctly. You can try again as often as you like.

Question 1 of 3What is a computer program?
Question 2 of 3What will this Python program display?
print("Apple")
print("Orange")
Question 3 of 3What does it mean to run a program?