diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 20:22:09 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 20:22:09 +0100 |
| commit | 5a8dbc6347b3541e84fe669b22c17ad3b715e258 (patch) | |
| tree | b148c450939688caaaeb4adac6f2faa1eaffe649 /samples/test.py | |
| download | qwe-editor-5a8dbc6347b3541e84fe669b22c17ad3b715e258.tar.gz | |
Engage!
Diffstat (limited to 'samples/test.py')
| -rw-r--r-- | samples/test.py | 20 |
1 files changed, 20 insertions, 0 deletions
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}") |
