Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data/python/recursion
diff options
context:
space:
mode:
Diffstat (limited to 'data/python/recursion')
-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)