Programming: Getting started

Your first program

In programming, it is traditional for the first program you write to output "Hello, World!".

A "Hello, World!" program is also traditionally the first thing you use to check that a programming language / environment has been installed correctly.

To do this in Python, we execute the following line of code:

print("Hello, World!")

Copy the above line of code, by clicking on the blue icon to the right of the code, and paste it into an online Python console to run it.

Click on the run button to view the result.

print() is the function used in Python to output to the console. Note the quote marks around the words. 

The print() function accepts a string as an argument. In Python, a string is a sequence of characters enclosed within single ' ' or double " " quotes. It is a group of zero or more characters (a character is a letter, digit or other symbol, including punctuation marks and spaces).