Once you’re using a text editor you can save files using a .py extension and then open them from the shell by running:
Hello World!
Let’s write our first Python program, and print Hello World! to our screen!
To do this, in the Python interpreter, use Python’s print function as follows:
The output displayed in the shell is:
In this program, we’ve used Python’s built-in print function. Soon you’ll learn about many more of these built-in functions and how to create your own.
Footnotes
[1] The Python interpreter is the application that runs your Python script.
The interpreter is a quick way to explore Python and try out code without creating a file. It is a Read-Eval-Print Loop, or REPL, a tool offered by many modern programming languages.
To use it, you launch the Python interpreter with python3, python or python -i and type your Python code at the prompt. The interpreter evaluates the code you type and displays the results.
[2] The shell, also known as the command line, is a program which processes shell scripts, like Bash. Shell scripts allow you to manipulate and navigate between files, execute programs, and print text. The shell is run through the terminal.