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 Computational Thinking and Programming in Python, Appunti di Elementi di Informatica

esame del primo anno del corso innovation and technology management presso l'Università Cattolica di Milano

Tipologia: Appunti

2019/2020

Caricato il 31/08/2020

francesco-locatelli-1
francesco-locatelli-1 🇮🇹

1 documento

1 / 4

Toggle sidebar

Questa pagina non è visibile nell’anteprima

Non perderti parti importanti!

bg1
IT Coding
First lesson
Big data means that you have trillions of bytes to work on
Big data is 3v (volume velocity and variability (many different aspects to integrate to get some
knowledge)) cloud computing is important because is very cheap to leave competencies of power.
What is computational thinking? It’s a very important change, it is the process involved in
formulating problems and their solutions are represent in a form that can be effectively carried
out by an information-processing system
How complex is a problem, the solution range is so large or there are lot of problem not solvable
Computational thinking is not a technical skill, is not being expert in a computer or thinking like a
computer, is not coding, making very efficient programs
Basic tools:
Abstraction: the ability to filter out information that is not necessary to solve a certain type
of problem.
Generalization: the formulating of general concepts from specific instance by abstracting
common properties.
Algorithms is like a cooking recipe, you have to follow the recipe to achieve your goal, it must be
unambiguous for the human that don’t understand what the algorithm tells but computers that
are very fast understand what to do with the algorithm an algorithm is an ordered set of
ambiguous, executable steps that defines a terminating process
Algorithm primitives, primitive are very common semantic structures
Name = expression (ex. Year = 2018) semantic allocate a memory area (named “year”
suited for storing the integer value 2018 it may be “1 year = 2018” or “first year = 2018”,
year is different from Year (my bird year = 1968 myBirthYear = 1968) the second is
Camel Casing (use the capital letter to divide words) it’s a way to describe the subdivision
of the sequence, use self-descriptive name is easier to understand (not use the variable x
because is not compressible for other people, some assignment are primitive such as
myName=”Francesco locatelli”, expression can be computer expression (ex.
ramainingFunds = checkingBalance + savingsBalance), index = index +1
Data types are the different types of data, numeric, strings and Boolean, the only operation
between strings is + that concatenates two strings (x = “hello” * “daniele” is an error).
Boolean is a logical value that has only 2 values: TRUE or FALSE, x = a != b (means that
a is not equal to b)
binary operations: AND / OR / XOR
And is true when both a & b are true
Or is true when at least one between a or b is true
Xor is true when just one of a or b is true
Conditions: ex. If a > 0 it is positive numberRange = “a is positive”
Iteration primitive: another common semantic structure is the repeated execution of a statement
or sequence of statement as long as some condition remains true. While: statement 1 statement 2
statement 4
Example: sum=0 – i=1(initialization) (sum & i are variables) while i<5 (termination condition)
sum=sum+i or i=i+1 what is the value of sum????????
Lists are basic connection of elements list=[1,2,3,4,5]
pf3
pf4

Anteprima parziale del testo

Scarica Introduction to Computational Thinking and Programming in Python e più Appunti in PDF di Elementi di Informatica solo su Docsity!

IT Coding First lesson Big data means that you have trillions of bytes to work on Big data is 3v (volume velocity and variability (many different aspects to integrate to get some knowledge)) cloud computing is important because is very cheap to leave competencies of power. What is computational thinking? It’s a very important change, it is the process involved in formulating problems and their solutions are represent in a form that can be effectively carried out by an information-processing system How complex is a problem, the solution range is so large or there are lot of problem not solvable Computational thinking is not a technical skill, is not being expert in a computer or thinking like a computer, is not coding, making very efficient programs Basic tools:  Abstraction: the ability to filter out information that is not necessary to solve a certain type of problem.  Generalization: the formulating of general concepts from specific instance by abstracting common properties. Algorithms is like a cooking recipe, you have to follow the recipe to achieve your goal, it must be unambiguous for the human that don’t understand what the algorithm tells but computers that are very fast understand what to do with the algorithm an algorithm is an ordered set of ambiguous, executable steps that defines a terminating process Algorithm primitives, primitive are very common semantic structures  Name = expression (ex. Year = 2018 ) semantic  allocate a memory area (named “year” suited for storing the integer value 2018 it may be “1 year = 2018” or “first year = 2018”, year is different from Year (my bird year = 1968  myBirthYear = 1968) the second is Camel Casing (use the capital letter to divide words) it’s a way to describe the subdivision of the sequence, use self-descriptive name is easier to understand (not use the variable x because is not compressible for other people, some assignment are primitive such as myName=”Francesco locatelli”, expression can be computer expression (ex. ramainingFunds = checkingBalance + savingsBalance), index = index +  Data types are the different types of data, numeric, strings and Boolean, the only operation between strings is + that concatenates two strings (x = “hello” * “daniele” is an error). Boolean is a logical value that has only 2 values: TRUE or FALSE , x = a != b (means that a is not equal to b) binary operations: AND / OR / XORAnd is true when both a & b are true  Or is true when at least one between a or b is true  Xor is true when just one of a or b is true Conditions: ex. If a > 0 it is positive  numberRange = “a is positive” Iteration primitive: another common semantic structure is the repeated execution of a statement or sequence of statement as long as some condition remains true. While: statement 1 statement 2 statement 4 Example: sum=0 – i=1(initialization) (sum & i are variables) while i<5 (termination condition)  sum=sum+i or i=i+1 what is the value of sum???????? Lists are basic connection of elements list=[1,2,3,4,5]

Second lesson Most of programmed activities had been coded and stored in library that can be available to our programs. When I have a problem, I can try to decompose the problem in different parts and try to solve them. There is some complication when we make a unit: scope of variables, that could be spatial, partial of scope that wear this variable act, or temporal Global variable defined outside the functions and they Ex: (the variable n is always present, and the variable i&sum are cancelled when the function ends) def sumOfFirstIntegers(n) sum= i= while i<=n : sum=sum+i I=i+ return sum

funzione blocco di istruzione che svolge qualcosa, definisci una funzione, la funzione al suo interno definisce delle variabili, sum è definita solo all’interno della funzione, se dall’esterno cerco di accedere ad una variabile non riesco perché esiste solo all’interno della funzione (concetto spaziale), ed esiste solo mentre esiste questa funzione (concetto temporale), esistono delle variabili globali che possono essere lette dappertutto, alcune variabili necessitano che vengano definiti dei parametri (n) se non è presente questo valore è ERRORE

function Application programming interface (API) need to know approach code reusability permits us to reuse our code in different functions procedural paradigm, it is based in the concept of procedure, set of computational steps to be carried out (we use this) one other paradigm is the object-oriented paradigm, this object exposes behavior and data, identification of main entities simple problem  compute the mean of a list of number  With the procedural paradigm compute the mean of a list of number (mean object)  With the object-oriented paradigm, we compute the mean of a list of number (object  mean)

Third lesson

A function is an abstract tool we use to solve a problem

Formal parameters are description of the data

Conditional statement

Provide an example of conditional statement in python

Tab is using to specify a block of function

What is a data type in phyton

What are the principal actions on a list