From 900247cdf50ebec6bb0cf5f56eb9ffb1bc8fab73 Mon Sep 17 00:00:00 2001 From: Samuel Weber Date: Wed, 25 Feb 2026 23:10:31 +0100 Subject: [PATCH 1/3] feat: add addition function and its test-function --- .pre-config.yaml | 18 ++++++++++++++++++ src/__init__.py | 0 src/moduleA.py | 10 ++++++++++ tests/test_moduleA.py | 6 ++++++ 4 files changed, 34 insertions(+) create mode 100644 .pre-config.yaml create mode 100644 src/__init__.py create mode 100644 src/moduleA.py create mode 100644 tests/test_moduleA.py diff --git a/.pre-config.yaml b/.pre-config.yaml new file mode 100644 index 0000000..a00cee1 --- /dev/null +++ b/.pre-config.yaml @@ -0,0 +1,18 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.3.0 + hooks: + - id: ruff # Linting + + - repo: https://github.com/psf/black + rev: stable + hooks: + - id: black # formatting diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/moduleA.py b/src/moduleA.py new file mode 100644 index 0000000..b7f0906 --- /dev/null +++ b/src/moduleA.py @@ -0,0 +1,10 @@ +def addition(a=1, b=2): + return a + b + + +def f(x: int, y: int) -> int: + return x + y + + +if __name__ == "__main__": + print(addition(5, 5)) diff --git a/tests/test_moduleA.py b/tests/test_moduleA.py new file mode 100644 index 0000000..42fe6cc --- /dev/null +++ b/tests/test_moduleA.py @@ -0,0 +1,6 @@ +from src.moduleA import addition + + +def test_a(): + assert addition() == 3 + assert addition(5, 5) == 10 From 422dd8b5e782e40298da7c2fc463303173142dfe Mon Sep 17 00:00:00 2001 From: Samuel Weber Date: Wed, 25 Feb 2026 23:11:26 +0100 Subject: [PATCH 2/3] feat: add addition function and its test-function --- .pre-config.yaml => .pre-commit-config.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .pre-config.yaml => .pre-commit-config.yaml (100%) diff --git a/.pre-config.yaml b/.pre-commit-config.yaml similarity index 100% rename from .pre-config.yaml rename to .pre-commit-config.yaml From c5dd88145e1d380bc93614ba4916eb303ac16e3c Mon Sep 17 00:00:00 2001 From: Samuel Weber Date: Wed, 25 Feb 2026 23:23:35 +0100 Subject: [PATCH 3/3] neue Aufgabe Ip --- src/count_ip_addresses.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/count_ip_addresses.py diff --git a/src/count_ip_addresses.py b/src/count_ip_addresses.py new file mode 100644 index 0000000..b538448 --- /dev/null +++ b/src/count_ip_addresses.py @@ -0,0 +1,7 @@ +def ips_between(start, end): + start_a = start.split(".") + end_a = end.split(".") + difference = 0 + for index, i in enumerate(start_a): + difference += (int(end_a[index]) - int(i)) * 256 ** (3 - index) + return difference