Archive for the 'Family' Category

He can explain how it works, can you?

Posted in Family on March 9th, 2007

My little brother Joel (11) and I made this.

  1. import random
  2. number = random.randint(1,100)
  3. guess = int(raw_input("enter a number"))
  4. while guess != number:
  5.  if guess > number:
  6.   print "Too high!"
  7.  if guess < number:
  8.   print "Too low!"
  9.  guess = int(raw_input("enter a number"))
  10. print "You Win!!!!!!"

It’s been expanded since the copy I have to limit the number of guesses you get. (He’s carrying it around on his flash drive)