Docsity
Docsity

Prepara i tuoi esami
Prepara i tuoi esami

Studia grazie alle numerose risorse presenti su Docsity


Ottieni i punti per scaricare
Ottieni i punti per scaricare

Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium


Guide e consigli
Guide e consigli


Introduction to Python v2 2024, Appunti di Fondamenti di informatica

Il documento "Introduction to Python v2" è un corso completo dedicato all'apprendimento del linguaggio di programmazione Python, particolarmente utile per la data science e l'analisi statistica. Pubblicato il 18 gennaio 2024, il materiale copre argomenti fondamentali come l'installazione di Python, l'uso di ambienti di sviluppo come Spyder e PyCharm, e le basi della programmazione, tra cui istruzioni, commenti, parole chiave e l'importante sistema di indentazione. Il corso include anche esempi pratici, come il classico "Hello World!", e approfondisce temi avanzati come la programmazione orientata agli oggetti e l'uso di pacchetti. Vengono evidenziati i pro e i contro di Python, come la sua facilità d'uso e leggibilità rispetto alla minore velocità e consumo di memoria. Il tono è didattico e incoraggiante, con esercizi e soluzioni per facilitare l'apprendimento. Ideale per chi vuole muovere i primi passi nel mondo della programmazione con Python.

Tipologia: Appunti

2024/2025

Caricato il 15/05/2025

charles-khama
charles-khama 🇮🇹

3.4

(23)

8.3K documenti

1 / 50

Toggle sidebar

Questa pagina non è visibile nell’anteprima

Non perderti parti importanti!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32

Anteprima parziale del testo

Scarica Introduction to Python v2 2024 e più Appunti in PDF di Fondamenti di informatica solo su Docsity!

5/15/25, 5:52 PM ‘about:blank Introduction to Python v2 2024-01-18 18 17 05 Introduction to Python Abstract: Welcome 10 iis coursa cedicatec 10 ne use and he understanding of the programming language Python. Thi praga mina anziane (è cons dere ae ore ofthe most popular tools in tha data science and statistical communities. lt car fe ty ein fr many Lance such ast data management ndlling and pradict, a In tha course, we wilinrodce you te (ho Pyihen snviroament, a the fundamental principles of the tool, to data treatment, But also to. more advanced features sucti xs funcllors, dala visvalizalicne, alital aols ané advance anaitics four. Alte end ol Pis course, j0u ll be able 10 rezd end understand (basic) Python code, bu: also wie i pouseli ti you are 10a6y, [ofs get siartodi Goal: Thi course has bon sol up 10 olo ov = understand the benefits and the limits oîthe Python programming larguar » assimilate coding principles end main smaxes = be aureo the main ataiatica Teaturea ihat zan ba used n Phon i he siii of data science prese [among oneri. Coding practice: Thi retebaok presente examale nf socia Implarsenting the main basic fureionnalifies potenli use fora data scan pojest. tie net Possibo t0 run dhe providod axaniploa dircoty in {his noleook [ss iis a hi floj but you car ol causa istali yin (300 below] and replicate ihe coding examples in your environment (e.g. using Spyder 29 explained below, “There sr aio aome axercias avallabie in most ol he secicna so ihat yau can practice yourself n your Python endranment. Anauars o” int ara usuali pcidad lo Mel ynu ocean Fave tn Agenda Chapier 1 - introduction Chapter 2 - Getting started with Python Chapter 3 - Basics o Python programming Chaptor - First stops in programming Chaptar 5 - Introduction to Object rente programming Chepier 6 - Packages Chapter 1 - Introduction 14 Python history 1.2 Pros and cons of Python 1.1 Python history = Piihon hac been conceptualized by Guido Van Rossum in the late 19806. The name use ireprae by he TV Show Menty Python Flying Ciro 1/50 5/15/25, 5:52 PM ‘about:blank Introduction to Python v2 2024-01-18 18 17 05 + Python i a suzoessor af he ABC) programming language. ABC is 2 gi vanamente fd ben cel ope in he Netertanc. Jral-purpose programming language and programming = The goneral pujpose cf Pyihon is 1 provico an efficient highdevel programming langua language that i sony cas; 10 uso, uncerstand and shoe and anobject-riented programming * Pyihon has Lccomo ono of the most popular programming languages amor developers main anke 0 ils cen synax, codo ronda anc porlabiliy. = Python works cn lle main operating aystema such as Windows, Linux, Unix and MacOS. = Pyihon's first 10 version was relessed in 1984, A 2.0 version DI Phon aes release@ in 2002 and a 3.0 version vas released in 2008. Toray, n versione eoexiel: Python 27 and Pyihor 3. Wrle eoly minor patehes are apple 1 Pyihon 2.7, Python Qin constant development. The io Python Eranches hava baen develosed i parallel. Ac anneunced |n Navamber 2014 the supporti etop for Pio 27 in 2020, usore are theroforo cdvisos to move 10 Python 3. 11.2 The pros and cons of Python The pros and cons of Python are sitmmarized nelow Mast o Ina Fyihor's nana com rom i Nigiiexal language characters. 2/50 5/15/25, 5:52 PM Introduction to Python v2 2024-01-18 18 17 05 python ‘about:blank 4/50 5/15/25, 5:52 PM ‘about:blank Introduction to Python v2 2024-01-18 18 17 05 2.2 Integrated Development Environment +. Writing Python using the Python console ls great for very simple tasks, butit becomes much less convenient uan we have to face larger programming projects = An Integrated Development Environment (IDE n short) is a program dedicated to software davelopment that wil allow you to urto, test and improvo your codo in an casior way. * Using an IDE wil make things easier regarding many aspects such as codo completion, code insight, resource management, dobugging, etc. = There are many Python IDES such as: Spyder, PyCharm, Rodeo, Thonny, Jupyter, ac. We present io of hem below. 2.2.1 Spyder +. Spyder is an opon source IDE dedicated to Data Science tasks {hs too s in fact inciuded in the Anaconda packago managor distribution that ve wll present n the next section), + This IDE is quito intuitive and contains common features such as: code editor, syntax highighting, code completion, documentation browser, ole + The piclure below shows he graphical user interface of Spyder: a URTO IPPPA] fa Corano sap rn co ie, pis, cit firma = 3 pie e creme 5/50 5/15/25, 5:52 PM Introduction to Python v2 2024-01-18 18 17 05 Danuconpa zaino = Ax mentioned anove, Spyder ia included n ih Anancorda envimment ut aurh he application to start uri Pyinon sole A first example = For instance, bi us display the mossago "Holo Word" in the Spyder consolo. Frs coen Ananconda anc [auneh: Spycer. Tren, arte tha falling lin of coda (on 1h left of ihe Snyder intertace): rint (“Mella World i") Cid n "Ru" mm yy fl ea lb inviti o sv url fr) Trcn, 1 should get ho folowng osput win he Spor console (ui ino ignt of he Spyder interface): = A you can so, he iterfsco mere user rendi than bist of tha Seen conole. = By tho was. congrazuationsi You No just runmod your rst line of code with Spydor! = Yi re nua radi to lar ha Basics ol Pyinon programming Chapter 3 - Basics of Python programming In ths chapter, we wi give you some basics of ihe Python langage. This wil allow vou io urderszand the structure of Python cade so Ina ou Wil be abls (0 read i more casi. 3.1 Instructions 2.2 Comments 3.3 Key words and reserved words 3.4 Indentation ‘about:blank 7/50 5/15/25, 5:52 PM ‘about:blank Introduction to Python v2 2024-01-18 18 17 05 3.5 Symbols and operatore 3.1 Instructions = An Instruetton consi in a ot of characters defined by Uno dovoloper (lor cxamele youl) n ardor lo porlorm a spocifio task. This task sen lake many forms: print a value, wle a condiion, deine a variable, pic — Rememibot in tie grocisus sacion 0 Nevo alleady oncourlered ha folowng insiueton: pràsti*Hella Worldi*) Tris lello Work! Running Ia cade print ("Hello inerte ast he system i disc (or to nnt on tha sereni ih semenza World!) us givas he follow output print ell Word!) Hello werldi and print ‘Hello Mortal!) = Remarke for Python. there sno diffronco Beiwen ho insiretlone print! "Hello World = Tre nelruetlen i read For ho left to ine rcht. I trts athe beginning "the Inc and stops with tho ne break + Remark: yi can als use ie symbol} 10 end an ineiucion n his is pot very use necaise fis consideri reduce Ihe. readablity of he code = Imation cn ao he seiner on several rows hy masi ol ha symbol \. Fer'nelanne, el us consi he flinving anda pimitelo0) Mori) Hello verte! = Aso can sea. Ina above Iesinicio is sima” o iis ne: print(*HeTla Worldi*) - Exercise - Varta a program hat ul play ha fllwino sentanca: "Hell, he re yet?" ( Answer ) amari e ravazi Ina arewer, mava yoLe mouse (and fan ick) ver he Ward Anzusrabona. 3.2 Comments — Commente are very usata Python, Thay uil all you 10 give further dele about the inetructione.