Exercise 1: Execute Python scripts

Type the text below into a text editor and save as hello.py. Python files usually have the .py extension.

#!/usr/bin/env python3

print('hello world')

You can use any text editor to create a Python program. I recommend using a text editor that supports syntax highlighting (text colouring) and line numbers.

To start the program, we have to open the command line and type:

python hello.py

Related: Complete Python Bootcamp: Go from zero to hero in Python

What you see if successful

You should see a line of text showing “hello world”.
python windows

Study drill

Try the exercises below:

1. Make a Python program that prints your name.
2. Make a program that displays the lyrics of a song.

After completing these continue with the next exercise.

Getting started
Exercise 2: Variables