summaryrefslogtreecommitdiff
path: root/py_test_example.py
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2024-12-09 12:22:43 +0200
committerZhongheng Liu <z.liu@outlook.com.gr>2024-12-09 12:22:43 +0200
commit30c2d7c3a0c51cc3f07ec1b4c9c8ac0168078e9c (patch)
tree723e8c9122defdc0d3a99e7314342dd42cb262b0 /py_test_example.py
parent5527cda74cf6425eb3a3bc4a299bce75e227ca54 (diff)
downloadcs-y13-30c2d7c3a0c51cc3f07ec1b4c9c8ac0168078e9c.tar.gz
cs-y13-30c2d7c3a0c51cc3f07ec1b4c9c8ac0168078e9c.tar.bz2
cs-y13-30c2d7c3a0c51cc3f07ec1b4c9c8ac0168078e9c.zip
feat: add recursion example from test
Diffstat (limited to 'py_test_example.py')
-rw-r--r--py_test_example.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/py_test_example.py b/py_test_example.py
new file mode 100644
index 0000000..3386a11
--- /dev/null
+++ b/py_test_example.py
@@ -0,0 +1,7 @@
+def x(n: int):
+ if ( n == 0 ) or ( n == 1 ):
+ print(n, end="")
+ return
+ x(n // 2)
+ print(n % 2, end="")
+x(255)