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.
Yes—Python is an object-oriented programming language.
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.
Python is a free, open-source programming language.
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:
To code in Python, you'll need a text editor—preferably one designed for coding in Python. Python scripts can be saved as
.py files. Run the
.py file to run the script.
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()
Comments can be added using the
# sign. For example:
# This line is a comment. def function1(): print("function1 has run.") function1()
You can add the Python installation directly to your Windows PATH variable. Check out our full guide on adding python to the Path variable on Windows 10.