diff options
author | Zhongheng Liu <z.liu@outlook.com.gr> | 2024-12-09 12:22:43 +0200 |
---|---|---|
committer | Zhongheng Liu <z.liu@outlook.com.gr> | 2024-12-09 12:22:43 +0200 |
commit | 30c2d7c3a0c51cc3f07ec1b4c9c8ac0168078e9c (patch) | |
tree | 723e8c9122defdc0d3a99e7314342dd42cb262b0 /py_test_example.py | |
parent | 5527cda74cf6425eb3a3bc4a299bce75e227ca54 (diff) | |
download | cs-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.py | 7 |
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) |