Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorChris Ball <cjb@pullcord.laptop.org>2007-11-02 17:24:39 (GMT)
committer Chris Ball <cjb@pullcord.laptop.org>2007-11-02 17:24:39 (GMT)
commit377db92d51816513af9b869876d4c065f0cbce68 (patch)
treebe13373861d12673e25090ba61fcc647fd7ce6ed /data
parent92e275e225c29989263b87ed0f9a9f37f5e4f83a (diff)
New example, "guess", from Pilar Saenz; merge hello1 and hello2.
Diffstat (limited to 'data')
-rw-r--r--data/math/guess15
-rw-r--r--data/string/hello (renamed from data/string/hello2)0
-rw-r--r--data/string/hello11
3 files changed, 15 insertions, 1 deletions
diff --git a/data/math/guess b/data/math/guess
new file mode 100644
index 0000000..97ee098
--- /dev/null
+++ b/data/math/guess
@@ -0,0 +1,15 @@
+import random
+from random import randrange
+R = randrange(1,100)
+
+print "Guess a number between 1 and 100!"
+N = input("Enter a number: ")
+i=1
+while (N!=R):
+ if N>R:
+ print "Too big... try again"
+ else:
+ print "Too small.. try again"
+ N = input("Enter a number: ")
+ i=i+1
+print "You got it in ", i, "tries"
diff --git a/data/string/hello2 b/data/string/hello
index bb52fc2..bb52fc2 100644
--- a/data/string/hello2
+++ b/data/string/hello
diff --git a/data/string/hello1 b/data/string/hello1
deleted file mode 100644
index fc83ab2..0000000
--- a/data/string/hello1
+++ /dev/null
@@ -1 +0,0 @@
-print "Hello everyone!"