100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Total programming summary (800863-M-3) $7.03
Add to cart

Summary

Total programming summary (800863-M-3)

 9 views  0 purchase
  • Course
  • Institution
  • Book

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

Preview 4 out of 70  pages

  • No
  • 1 t/m 7, 9,10,13,16
  • November 7, 2024
  • 70
  • 2023/2024
  • Summary
avatar-seller
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

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller brittvandewouw23. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.03. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

55628 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.03
  • (0)
Add to cart
Added