Python is a high-level, interpreted, general-purpose programming language created by Guido van Rossum and first released in 1991. Its design philosophy emphasizes code readability with significant indentation. Python is dynamically-typed and garbage-collected, supporting multiple programming paradigms including procedural, object-oriented, and functional programming.
Python was conceived in the late 1980s as a successor to the ABC language. Python 2.0 was released in 2000, and Python 3.0 (breaking backward compatibility) arrived in 2008. As of 2025, Python 3.x is the only actively developed version, with Python 2 officially retired on January 1, 2020.
Python is one of the most popular programming languages in the world. It is used in web development (Django, Flask), data science (NumPy, pandas), machine learning (TensorFlow, PyTorch), automation, scripting, and more. Its simple syntax makes it an excellent first language for beginners.
Visit python.org/downloads and download the latest version for your operating system. During installation on Windows, make sure to check "Add Python to PATH".
Open a terminal (command prompt, PowerShell, or terminal) and run:
python --version
You should see output similar to Python 3.13.x.
A virtual environment is an isolated Python environment that lets you install packages specific to a project without interfering with your system-wide Python installation.
# Create a virtual environment
python -m venv myenv
# Activate it (Windows)
myenv\Scripts\activate
# Activate it (macOS/Linux)
source myenv/bin/activate
# Deactivate when done
deactivate
The quintessential first program in any language is printing "Hello, World!":
print("Hello, World!")
Save this in a file called hello.py and run it with:
python hello.py
Python also provides an interactive REPL (Read-Eval-Print Loop). Just type python in your terminal and start writing code line by line:
>>> print("Hello from the REPL!")
Hello from the REPL!
>>> 2 + 2
4
You can run Python in two ways:
.py file containing multiple lines of code. This is how real programs are executed.You can write Python in any text editor, but a good IDE boosts productivity.
PyCharm (by JetBrains) is a full-featured Python IDE. The free Community Edition is sufficient for learning. It offers intelligent code completion, debugging, and integrated virtual environment management.
Visual Studio Code with the Python extension (by Microsoft) is a popular, lightweight alternative. Install the Python extension from the marketplace and you will get linting, debugging, and IntelliSense.
Whether you use an IDE or a simple text editor, the workflow is the same: write code, save the file, and run python filename.py.
# hello.py
name = input("What is your name? ")
print(f"Hello, {name}! Welcome to Python.")
Install Python if you haven't already. Create a new virtual environment called learning. Write a script that asks the user for their name, age, and favorite color, then prints a sentence combining all three pieces of information. Run the script both from the terminal and inside your chosen IDE.