Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data/math/guess
blob: 68c07600866d9879c520f052d9df38aa382eb529 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import random
import pippy
R = random.randrange(1,100)

print "Guess a number between 1 and 100!"
N = input("Enter a number: ")
i=1
while (N!=R):
    if N>R:
        pippy.console.red()
        print "Too big... try again"
    else:
        pippy.console.blue()
        print "Too small.. try again"
    pippy.console.black()
    N = input("Enter a number: ")
    i=i+1
print "You got it in", i, "tries"