aboutsummaryrefslogtreecommitdiff
path: root/comparison/Python/ack3-11.py
diff options
context:
space:
mode:
authorShinya Sato <shinnya.sato@gmail.com>2021-10-24 23:04:45 +0900
committerShinya Sato <shinnya.sato@gmail.com>2021-10-24 23:04:45 +0900
commit787dc13c837f0955fbd85b8f26a05d720d361333 (patch)
treefec3abebb1e867e8b2239d7cf07b4c7d13ce0f81 /comparison/Python/ack3-11.py
parente607a57dfafb784c4e27da143214afb2ccd07fbf (diff)
downloadinpla-787dc13c837f0955fbd85b8f26a05d720d361333.tar.gz
inpla-787dc13c837f0955fbd85b8f26a05d720d361333.zip
Upload the comparison directory
Diffstat (limited to '')
-rw-r--r--comparison/Python/ack3-11.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/comparison/Python/ack3-11.py b/comparison/Python/ack3-11.py
new file mode 100644
index 0000000..3e831ac
--- /dev/null
+++ b/comparison/Python/ack3-11.py
@@ -0,0 +1,9 @@
+def ack(m,n):
+ if m==0:
+ return n+1
+ elif n==0:
+ return ack(m-1, 1)
+ else:
+ return ack(m-1, ack(m, n-1))
+
+print(ack(3,11))