Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data/python
diff options
context:
space:
mode:
authorChris Ball <cjb@pullcord.laptop.org>2007-08-28 21:36:32 (GMT)
committer Chris Ball <cjb@pullcord.laptop.org>2007-08-28 21:36:32 (GMT)
commita8eedd102ba32233d52fbb45b1f67b255d6e8396 (patch)
tree2e9709284a14cccafc2812ae7f9d3c72f55629c7 /data/python
parent4d3670ccd35eabbd3084ed932a3dffb0c23ff064 (diff)
Examples update.
Diffstat (limited to 'data/python')
-rw-r--r--data/python/recursion10
1 files changed, 10 insertions, 0 deletions
diff --git a/data/python/recursion b/data/python/recursion
new file mode 100644
index 0000000..c34638d
--- /dev/null
+++ b/data/python/recursion
@@ -0,0 +1,10 @@
+def countbackwards(number):
+ print "I have the number", number
+ if number > 0:
+ print "Calling countbackwards again!"
+ countbackwards(number-1)
+ else:
+ print "I am done counting"
+
+number = input("Enter a number: ")
+countbackwards(number)