Formatting Python code using black

As a beginner in a programming language, you will hardly deal with the topic of code formatting. However, the more the project grows and 100 lines of code become 1000, you should think about formatting your code. The same applies when several programmers work on the same project. Each of them may use a different … Read more

Binary Search

The second algorithm that I would like to introduce here is also a search algorithm, the binary search. The following example is about searching for a value in a list. To use binary search, it is necessary to first sort this list. The sort() method can be used for this: Next, you need to find … Read more

Linear Search in Python

The linear search is the simplest approach to search for an element in a data set. This search algorithm iterates over all elements – from the beginning to the end – of a list until the element searched for is found. The result in the following example is the index of the value found. This … Read more

The structure of a Python project

‎A Python project may initially consist of only one or two files. In this case, you don’t have to worry about a project structure. But the situation is different if the program grows. In addition to the actual Python code files, documentation could also be added at some point. And as a rule, the tests … Read more

Data structures in Python – Linked List

After queues and stacks, the third article on data structures deals with linked lists. This data structure has nodes that are connected to each other. Each node has a value and a pointer. The following figure shows a singly linked list where each node has only one pointer pointing to the next node. The first … Read more