Engineering Informatics Laboratory
Back to overviewProgramming, simulation and data processing - solving engineering exercises with computer support.
VS Code: .py & .ipynb
AvailableVS Code for getting started in Engineering Informatics: a guided click tour from the exercise folder through .py and .ipynb files to the interpreter, kernel and running code.
Variables
AvailableStore values in variables, calculate with them and output them with print(). Six exercises — from saving names to exchanging values — with an interactive Python editor in the browser.
List
AvailableOrdered collections of values in square brackets. Create, read index, replace element, append to list — the basic operations you need all the time.
Dictionary
AvailableKey-value storage in Python: create, read, change and extend. With interactive Python editor in the browser.
Branches (if/elif/else)
AvailableDecide in the code which block will be executed. You will learn the keywords if, elif and else, why the order of the elif branches matters and that only one branch runs at a time.
for loops
AvailableIterate over lists, strings and number ranges. You'll learn range(), the accumulator pattern, and iterating through strings character by character — with an interactive Python editor in the browser.
while loops
AvailableRepeat code as long as a condition is true. Counting loops, accumulators and handling termination conditions — with an interactive Python editor in the browser.
do-while loops
AvailablePython has no native do-while loop. You can reproduce it with while True and a break at the end of the block, ensuring that the code block runs at least once before the condition is evaluated.
Functions
AvailableReusable code blocks with def, parameters and return. Return multiple values as a tuple, call functions and store return values in variables.
Main block (`if __name__ == "main"`)
AvailableSeparate function definitions from the script flow: The main block only runs when the file is executed directly - it remains silent during import. Create variables, call a function, save the return — right up to tuple unpacking if there are multiple return values.
Logic
AvailableBoolean values, truth tables, and logic circuits in Python: from AND and De Morgan to the seven-segment display, the half adder, and a safe system enable.
Combined exercises
AvailableUse functions, conditions and loops together: define the function above, call it in the main block and process the returns. With interactive Python editor in the browser.
Tricky exercises
AvailableAlgorithmic exercises with lists, dictionaries and functions: sorting without sort(), counting frequencies, finding maximum and iterative approximation. With interactive Python editor in the browser.
Engineering applications
AvailableSmall engineering tasks with input and exact output: Read in values using input(), calculate them and output the result in the specified format. The test feeds fixed inputs and compares the output. Six exercises from electrical engineering, mechanics, flow and thermodynamics - from parallel connection to Reynolds number with case distinction.
Classes and Objects
AvailableFirst steps in object orientation: write a class as a blueprint, create objects from it, set up attributes with __init__ and self, and call the first method — using a dice as the example.
Methods and Objects in Action
AvailableObjects that calculate and introduce themselves: a measurement series with mean value, readable output via __str__, objects in loops, and a pressure sensor that checks readings for plausibility.
Inheritance
AvailableOne class builds on another: base class and subclass, super().__init__, inherited and overridden methods — from the general measurement object to the temperature experiment and the pressure series with limits.