site logo

Levels

Learn
GCSE-practice
Challenges

Tasks

Output
Operators - Numeric
Variables
Inputs
Operators - Strings
Operators - Booleans
Decisions
Range
Loops - For
Loops - While
Defs
Lists

Learn:Output

What We're Building
In this lesson you'll learn to output the following to the console.
Hello World
15
👌
Key Terms
In this lesson
Term
Description
Console
The area of the screen where we interact with the program.
Output
Displaying information in the console.
Print Command

We can use the print command to display numbers, text and characters to the console. In text based programs, the console is the main interface that we use to allow our program to interact with the user. Other ways that we interact with users include sound and files, but we will deal with these in later lessons.

Typical uses for the print command inlude:

  • Letting the user know the result of a calculation
  • Giving the user an update on a long running operation
  • Letting the user know something has gone wrong
  • Letting the user know that the program has ended.

To use the print command, type:

1print(<something to output to console>)

Some examples are:

1print("Hello World")
2print(10 + 5)
Hello World
15
Practice: level-1::output