# my_script.py
for i in range(1, 4):
print(i)1
2
3
Python is a programming language designed for its simple readability and ease of use.
Python is primarily executed as an interpreted language. This means that when you run your Python code, the Python Interpreter (which you get when you install Python) translates the code line by line into machine code that the computer understands at runtime (while the program is running).
What you install: Installing Python primarily downloads the Python Interpreter – the “translator” that makes your scripts work.
You can use Python in two main ways: ad-hoc in your terminal or as a script in a file.
The terminal (also called Shell, PowerShell, or Command Line) is a text-based interface to your computer.
By running python3 (or just python on some systems), you start the interactive interpreter and can directly enter and immediately execute Python commands: Bash
To exit the Python interpreter and return to the regular terminal, use the quit() function: Python
If you want to save code and run it repeatedly, you write it into a Python file (file extension .py). Python code is plain text, so you can create and edit it with any text editor.
To run a script, you enter the interpreter command followed by the path to your file in the terminal:
For faster and more efficient coding, you should use an Integrated Development Environment (IDE).
An IDE is a special application that makes writing code easier – comparable to the difference between a simple text editor and a program like Microsoft Word. It offers features such as:
There are many excellent IDEs available. Choose one you like, for example: VS Code, Spyder, or PyCharm. Essentially, they all serve the same purpose with different extra features.