summaryrefslogtreecommitdiffstats
path: root/fib.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2024-09-11 13:55:48 +0200
committerMatěj Cepl <mcepl@cepl.eu>2024-09-11 13:55:48 +0200
commit4c942256f99f82414811c3a7066370124562b80c (patch)
tree7f43415e61e5f415ed2ec5e00057f0750a621817 /fib.py
downloaddabeaz_pycon2015_gil-4c942256f99f82414811c3a7066370124562b80c.tar.gz
Examples from David Beazley talk at PyCon 2015HEADmaster
https://youtu.be/MCs5OvhV9S4
Diffstat (limited to 'fib.py')
-rw-r--r--fib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/fib.py b/fib.py
new file mode 100644
index 0000000..129fb51
--- /dev/null
+++ b/fib.py
@@ -0,0 +1,5 @@
+def fib(n):
+ if n <= 2:
+ return 1
+ else:
+ return fib(n-1) + fib(n-2)