Python is a cross-platform, open-source programming language. Its name comes from creator Guido van Rossum who felt inspired while reading scripts from the British comedy series Monty Python's Flying Circus.
Python can be used for a wide variety of both small and large-scale applications. You can use Python to program something simple like a clock display on a Raspberry Pi or something more complicated like a web app. Python can even be useful for calculating statistics or machine learning.
Python can be installed on Windows, Linux, and Mac systems. Python scripts can be written in any basic editor or text application. You can run Python-based applications or develop your own.
Python is available for download on the official Python website. There are different releases available on the downloads page. You can also download Python using a terminal application. The install command varies depending on your OS, terminal application, and edition you want to install.
The method for checking your Python version varies between operating systems.
MacOS users can verify their Python version with the terminal application using the following command.
Windows users can check their Python version through Powershell using this command.
If you're using Linux, you can use this command in a Terminal window.
A note on other Python installations
The above commands will check your system Python version. If you have installed another version of Python—Python 3, for instance—you would check the version like this:
Functions are defined using
def. See the example below. This code creates a function called
function1 that prints a string.
def function1(): print("function1 has run.")
To call a function in Python, use the name of the function along with a set of parentheses. In this example, a function is defined called
function1 and called with
def function1(): print("function1 has run.") function1()