From 5a8dbc6347b3541e84fe669b22c17ad3b715e258 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 21 Jan 2026 20:22:09 +0100 Subject: Engage! --- samples/test.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 samples/test.py (limited to 'samples/test.py') diff --git a/samples/test.py b/samples/test.py new file mode 100644 index 0000000..aaa4ad7 --- /dev/null +++ b/samples/test.py @@ -0,0 +1,20 @@ +def factorial(n): + # This is a comment explaining the function + if n <= 1: + return 1 + else: + return n * factorial(n - 1) + +class Calculator: + def __init__(self): + self.result = 0 + + def add(self, a, b): + """Docstring for add method""" + return a + b + +if __name__ == "__main__": + print("Factorial of 5 is:", factorial(5)) + calc = Calculator() + res = calc.add(10, 20) + print(f"Result: {res}") -- cgit v1.2.3