




























































































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!





























































































Python is an interpreted, object-oriented, high-level, general purpose, programming language. Conceived in the late 80s and released in 1991 by Guido Van Rossum at the Centrum Wiskunde & Informatica in the Netherlands. Managed by the nonprofit organization Python Software Foundation ( PSF ) as an open source project. Python was named after the British comedy group Monty Python's Flying Circus!
1991 – first version of Python released. 2000 – Python 2. 2008 – Python 3. Not backwards compatible with Python 2 Two main branches of Python survived: Python 2.7 and Python 3.x. Currently Python has reached version 3.13.0 (release date 7/10/24). Support to Python 2 has stopped in 2020. We are going to learn Python 3!
In most cases Python 2 and Python 3 do not differ that much. Often, adding a few parentheses will convert your Python 2 code to a perfectly fine Python 3 version. When you install Python, a tool called 2to3 will be also installed. It is a Python program that reads Python 2.x source code and applies a series of fixers to transform it into valid Python 3.x code. We will see the main differences between Python 2 and Python 3 as soon as we start coding!
import this – The Zen of Python
Windows
Linux
By installing Python, we are installing a Python Interpreter , a program that executes other (Python) programs. The interpreter reads the program and carries out the instructions it contains. The interpreter acts as a layer between the software you write and the hardware on your machine. There are different interpreters, and can be written in different programming languages. The most common interpreter is written in C!
Throughout this course we will use several Integrated Development Enviroments (IDE) : PyCharm Visual Studio Code Spyder Thonny Jupyter Notebooks/Google Colab IDLE
VSCode Probably the most usable Python IDE. You can download it from https://code.visualstudio.com/
Thonny A minimal yet functional Python IDE for beginners. https://thonny.org/ LabTecInf 2018/2019 - F. Becattini 18
IDLE ( I ntegrated D evelopment and L earning E nvironment) is an interactive interpreter where we can execute python code, it is installed with Python. 20
LabTecInf 2018/2019 - F. Becattini
Python is an interpreted language (unlike C). This means that the code is not directly compiled into instructions for the specific hardware of your machine. Instead, the code is compiled into an intermediate language called Byte Code. This translation progenerates a platform-independent source code stored in a *.pyc file (‘’compiled py’’). To execute the code, the Byte Code is then translated at runtime by the Python Virtual Machine ( PVM )