Documente Academic
Documente Profesional
Documente Cultură
în
Programare
Prof. univ. dr. Gheorghe Grigoraș
https://profs.info.uaic.ro/~grigoras/geo
Care este scopul cursului?
https://docs.python.org/3/contents.html
https://www.python.org/
https://wiki.python.org/moin/BeginnersGuide
https://docs.python.org/2/tutorial/
https://www.python.org/downloads/
https://wiki.python.org/moin/IntroductoryBooks
http://it-ebooks.info/read/304/
https://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html
https://docs.python.org/2/library/idle.html
https://www.tutorialspoint.com/python3/
https://www.youtube.com/watch?v=bOvqYw1SZJg
Plan
Elemente de programare:
Ce este programarea?
Scurtă istorie
Filozofia limbajului Python
Execuția codului Python
Cum scriem cod/Algoritmi
Ce este Programarea?
Să-i spui unui computer ce să facă: folosești un limbaj adecvat (limbaj de
programare), scrii comenzile într-un fișier text sau le transmiți la un
promter.
Codul este scris în fișier text și este numit cod sursă (uneori “src”). În
Python, fiecare comandă este scrisă pe o linie nouă.
Codul are o sintaxă specifică ce cuprinde cuvinte cheie (keywords) și
operatori care au un înțeles aparte pentru computer. De exemplu if este
control flow keyword: el controlează fluxul programului pe baza unei
condiții.
Unul sau mai multe fișiere(adesea scrise de diverși programatori) constitue
împreună un program.
De ce Python?
These are sometimes called Low Level Languages as they are close to the
details by which the computer works: they have low levels of abstraction.
Scurtă istorie privind Programarea:
High Level Languages
Mid 1950’s Third Generation Languages: in a human readable form,
e.g. ‘4 + 2’. (Fortran, ALGOL, COBOL, C, C++, C#, Java, BASIC , Pascal)
Fourth Generation Languages try to let people describe what they want to do,
without complicating things with how they’re done.(Visual FoxPro, SQL, MATLAB)
Fifth Generation Languages centre on describing what a problem solution looks like
and getting a computer to find it.
Such languages hide how the computer works, and are therefore called High Level
Languages.
Se folosește un cuvânt cheie pentru control flow numit goto pentru saltul
la o nouă linie:
10: if file missing goto 20 (Pseudocode, not
15: read file goto 25 Python)
20: exit program
25: print file
Programele mari de acest fel sunt denumite spaghetti code.
Proceduri
print (
4 + int(
input(
"Type a number to add to four“
)
)
)
Limbaje “Object Oriented”
În Limbajele Orientate pe Obiect se construiesc bucăți de cod numite
‘Clase’ care pot conține date și proceduri pentru manipularea acestora.
Monty Python’s Flying Circus (known during the final series as just Monty Python) is a British
sketch comedy series created by the comedy group Monty Python and broadcast by the BBC from
1969 to 1974.
[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 10, 20, 30, 40, 50]
for counter1 in {5, 10}:
for counter2 in {1,2,3,4,5,6,7,8,9,10}:
if (counter1 * counter2) % 2 == 0 :
print (counter1 * counter2)
Distribuția Anaconda
Anaconda
>>>
Identificarea și eliminarea erorilor (Debugging)
Referințe la limbaj:
https://docs.python.org/3/reference/index.html
Python Wiki:
https://wiki.python.org/moin/