11---
2- title : " Lecture I - Introduction "
2+ title : " Cheatsheet "
33subtitle : " Programming with Python"
44author : " Dr. Tobias Vlćek"
5- institute : " Kühne Logistics University Hamburg - Fall 2024"
65title-slide-attributes :
76 data-background-color : " #FFE0D3"
87
@@ -16,44 +15,21 @@ format:
1615 documentclass : report
1716---
1817
19- # Cheatsheet
2018
2119# Lecture I
2220
23- ---
24- title: "Lecture I - Introduction"
25- subtitle: "Programming with Python"
26- author: "Dr. Tobias Vlćek"
27- institute: "Kühne Logistics University Hamburg - Fall 2024"
28- title-slide-attributes:
29- data-background-color: "#FFE0D3"
30-
31- execute:
32- echo: true
33-
34- format:
35- html:
36- theme: [ litera, ../styles_html.scss]
37- pdf:
38- documentclass: report
39- ---
40-
41- # Cheatsheet - Lecture I
42-
43- ## Key Concepts
44-
45- ### Python Basics
21+ ## Python Basics
4622- Python is an ** interpreted language** - code is executed line by line
4723- Comments start with ` # `
4824- Code blocks are defined by indentation
4925
50- ### Variables
26+ ## Variables
5127- Created using assignment operator ` = `
5228- Must start with letter or underscore
5329- Case sensitive
5430- Cannot use reserved words
5531
56- ### Data Types
32+ ## Data Types
57331 . ** Strings (str)**
5834 - Enclosed in quotes: ` "Hello" ` or ` 'Hello' `
5935 - F-strings: ` f"Value is {variable}" `
@@ -66,7 +42,7 @@ format:
66423 . ** Booleans (bool)**
6743 - ` True ` or ` False `
6844
69- ### Basic Operators
45+ ## Basic Operators
7046``` python
7147# Arithmetic
7248addition = 1 + 2 # 3
@@ -78,7 +54,7 @@ exponentiation = 9 ** 0.5 # 3.0
7854modulo = 10 % 3 # 1
7955```
8056
81- ### Common Functions
57+ ## Common Functions
8258``` python
8359# Input/Output
8460print (" Hello" ) # Display output
@@ -202,6 +178,8 @@ while True:
2021784 . Avoid infinite loops
2031795 . Keep code blocks focused and manageable
204180
181+ ---
182+
205183# Lecture III
206184
207185## Functions
@@ -325,6 +303,8 @@ class Child(Parent):
325303 - variable_name (snake_case)
326304
327305
306+ ---
307+
328308# Lecture IV
329309
330310## Tuples
@@ -440,6 +420,8 @@ with open("file.txt", "r") as file:
4404205 . Always use ` with ` statement for file operations
4414216 . Close files after use if not using ` with `
442422
423+ ---
424+
443425# Lecture V
444426
445427## Common Built-in Exceptions
@@ -540,9 +522,9 @@ assert x == expected_value, f"x should be {expected_value}, but got {x}"
5405224 . Test the fix
5415235 . Add error handling if needed
542524
543- ```
525+ ---
544526
545- # Cheatsheet - Lecture VI
527+ # Lecture VI
546528
547529## Modules
548530
@@ -655,14 +637,9 @@ pip list
6556375 . Document package dependencies
6566386 . Use regular expressions carefully and test them thoroughly
657639
658- ## Common Errors
659- - ** ImportError** : Module not found
660- - ** ModuleNotFoundError** : Package not installed
661- - ** AttributeError** : Module attribute not found
662- - ** re.error** : Invalid regular expression pattern
663- - ** PermissionError** : File access denied
640+ ---
664641
665- # Cheatsheet - Lecture VII
642+ # Lecture VII
666643
667644## NumPy Basics
668645
0 commit comments