Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Programming College Notes (800863-M-3)

Rating
-
Sold
-
Pages
21
Uploaded on
26-06-2024
Written in
2023/2024

Notes from the course RS: Programming for the Communication and Information Sciences course at Tilburg University. Supplemented with notes from the exercises and mandatory scientific articles. The document is written in English.

Institution
Course

Content preview

Summary Programming
Lecture 1 (30/01/2024)................................................................................3
What is Python?........................................................................................3
Using Python as a calculator.....................................................................3
Data types................................................................................................4
Boolean values..........................................................................................4
If statements.............................................................................................4
Lecture 2 (06/02/2024)................................................................................4
Value collections.......................................................................................4
Container sequences................................................................................5
Lists.......................................................................................................5
Dictionaries............................................................................................6
Loops........................................................................................................6
Functions...................................................................................................7
Lecture 3 (20/02/2024)................................................................................7
String manipulation...................................................................................7
Membership test operation.......................................................................8
Regular expressions..................................................................................9
Process...................................................................................................9
Metacharacters......................................................................................9
Repeating.............................................................................................11
Match types.........................................................................................11
Grouping..............................................................................................12
Lecture 4 (27/02/2024)..............................................................................12
Text files..................................................................................................12
Opening and closing a text file............................................................13
Functions in a text file..........................................................................13
Organizing and scanning directories/files............................................14
Lecture 5 (05/03/2024)..............................................................................15
Using Python to work with files...............................................................15
Spreadsheets.......................................................................................15
Installing libraries....................................................................................15


1

, Working with openpyxl............................................................................16
Reading files........................................................................................16
Creating an excel file...........................................................................16
Lecture 6 (12/03/2024)..............................................................................17
Csv files...................................................................................................17
Excel file to CSV and the other way around.........................................17
Opening csv files..................................................................................17
Writing csv files....................................................................................18
Json files..................................................................................................18
Opening json files................................................................................18
Writing json files..................................................................................19
Lecture 7 (19/03/2024)..............................................................................19
Important themes during the exam........................................................19
About the exam......................................................................................20
Links to use................................................................................................20




2

, Lecture 1 (30/01/2024)
What is Python?
Python is a programming language. It can do some calculations but is
more than just a regular calculator. It has a certain grammar. If you don’t
use the correct grammar, it will give an error.


Using Python as a calculator
Important to know are:
 Operator: these are special symbols that indicate that some sort of
computation should be performed. The operator operates on
values/operands. There are different types of operators:
o Arithmetic operators:
 Exponent: **
For example: 2 ** 3 = 8
 Modulus/remainder: %
For example: 22 % 8 = 6
 Integer division/floored quotient: //
For example: 22 // 8 = 2
 Division: /
For example: = 2.75
 Multiplication: *
For example: 3 * 5 = 15
 Subtraction: -
For example: 5 – 2 = 3
 Addition: +
For example: 2 + 2 = 4
o Comparison operators: these values are used to compare
and evaluate down to a single Boolean value.
 Equal to: ==
 Not equal to: ! =
 Less than: <
 Greater than: >
 Less than or equal to: < =
 Greater than or equal to: > =
 Value: these are also called operands. This is what the operator
acts on.
 Expression: a sequence of operands and operators. This is the total
sum.
 Evaluation: reducing the expression down to a single value. This is
the answer you’ll get in the end.
 Variables: we can store a value in a variable. It is basically like
saving a (temporary) file, storing it for later. For example: spam =
42. The variable spam now has the integer value 42 in it.
 Expression statement: this states that something is something.

3

Written for

Institution
Study
Course

Document information

Uploaded on
June 26, 2024
Number of pages
21
Written in
2023/2024
Type
Class notes
Professor(s)
C. van der lee
Contains
All classes

Subjects

$9.24
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
joymennings1 Vrije Universiteit Brussel
Follow You need to be logged in order to follow users or courses
Sold
19
Member since
3 year
Number of followers
2
Documents
8
Last sold
1 year 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 tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

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

Student with book image

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

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions