100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Total programming summary (800863-M-3)

Rating
-
Sold
1
Pages
70
Uploaded on
07-11-2024
Written in
2023/2024

Total summary of the programming course; lectures + book 8.5 for exam!!

Institution
Course











Whoops! We can’t load your doc right now. Try again or contact support.

Connected book

Written for

Institution
Study
Course

Document information

Summarized whole book?
No
Which chapters are summarized?
1 t/m 7, 9,10,13,16
Uploaded on
November 7, 2024
Number of pages
70
Written in
2023/2024
Type
Summary

Subjects

Content preview

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

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
brittvandewouw23 Tilburg University
Follow You need to be logged in order to follow users or courses
Sold
17
Member since
1 year
Number of followers
0
Documents
10
Last sold
6 months ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions