From 377db92d51816513af9b869876d4c065f0cbce68 Mon Sep 17 00:00:00 2001 From: Chris Ball Date: Fri, 02 Nov 2007 17:24:39 +0000 Subject: New example, "guess", from Pilar Saenz; merge hello1 and hello2. --- (limited to 'data') 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!" -- cgit v0.9.1