100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Samenvatting

Totale samenvatting vak programming (800863-M-3)

Beoordeling
-
Verkocht
1
Pagina's
70
Geüpload op
07-11-2024
Geschreven in
2023/2024

Totale samenvatting van het vak programming; lectures + boek 8.5 for exam!!












Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Documentinformatie

Heel boek samengevat?
Nee
Wat is er van het boek samengevat?
1 t/m 7, 9,10,13,16
Geüpload op
7 november 2024
Aantal pagina's
70
Geschreven in
2023/2024
Type
Samenvatting

Voorbeeld van de inhoud

1



Programming
Week 1 1
Chapter 1 1
Chapter 2 3
Lecture 1 6
Week 2 8
Chapter 2 8
Chapter 3 11
Chapter 4 15
Chapter 5 22
Lecture 2 24
Week 3 27
Chapter 6 27
Chapter 7 32
Lecture 3 39
Week 4 44
Chapter 9 44
Chapter 10 49
Lecture 4 52
Week 5 55
Chapter 13 55
Lecture 5 59
Week 6 61
Chapter 16 61
Lecture 6 65
Week 7 68
Lecture 7 68



Week 1

Chapter 1
Interactive shell -> REPL: read-evaluate-print loop -> lets you run (execute) python instructions
one at the time and instantly shows you the results.

Entering expressions in to the interactive shell
Launching the Mu editor, download when going through the set up in the preface.
MacOS open your applications folder and double click Mu

, 2


Click the new button and save an empty file as blank.py
When you run this blank file by clicking the run button, it will open the interactive shell which will
open as new pane that opens at the bottom of the Mu editor window.




The integer, floating-point, and string data types




Stings -> strs => need to put ‘ ‘ around a string
Error message: syntaxError: EOL while scanning string literal => probably forgot the final single
quote character at the end of a string.

String concatenation and replication
+ It joins the stings as the string concatenation operator
>>> ‘alice’+’bob’
‘Alicebob’

>>> ‘alice’ + 42
Can't use a string in combination with a integer value => TypeError: can only concatenate str
(not “int” to str

The * operator multiples two integer or floating-point values, but when * is used on one string
value and one integer value it becomes the string replication operator.
>>> ‘alice’ * 5
‘Alicealicealicealicealice’

, 3



Storing values in variables
A variable is initialized or created the first time a value is stored in it. After that you can use it in
expression with other variables and values. When a variable is assigned a new value the old
value is forgotten. This is called overwriting the variable.

A good variable name describes the data it contains. There are three rules:
- It can be only one word with no spaces
- It can use only letters, numbers and the underscore (_) character
- It can't begin with a number
Variable names are case-sensitive. Consistency with the style guide is important.



Chapter 2
Flow control statements can decide which python instructions to execute under which
conditions. These flow control statements directly correspond to the symbols in a flow chart.
-> flow chart is een goede representation of hoe programeren werkt

Boolean values
Boolean data type has two values: True and False -> always with capital F or T
Like any other value, boolean values are used in expressions and can be stored in variables. If
you don't use the proper case or you use true and false for variable names python will give an
error.

Comparison operators
Comparison operators, also called relational operators, compare two values and evaluate down
to a single boolean value.




An integer or floating-point value will always be unequal to a string value.
The <,>,<= and >= operators work properly only with integer and floating point values.

Boolean operators
Three boolean operators (and, or, and not) are used to compare boolean values. Like
comparison operators, they evaluate these expressions down to boolean values.

, 4



- Binary boolean operators: the ‘and’ and ‘or’ operators always take two boolean values
(or expressions) so they are considered binary operators.
The and operator evaluate an expression to true if both boolean values are true otherwise it
evaluates to false.




The or operator evaluates an expression to true if either of the two boolean values is true. If
both are false it evaluates to false.




- Unary operator -> The not operator
Unlike and/or the not operator operates only on e boolean value (or expression). This makes it a
unary operator. The not operator simply evaluates the opposite boolean value.

>>> not True
False

>>> not not not not Ture
True

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
brittvandewouw23 Tilburg University
Bekijk profiel
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
17
Lid sinds
1 jaar
Aantal volgers
0
Documenten
10
Laatst verkocht
6 maanden geleden

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen